This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // reference https://dev.epicgames.com/community/learning/tutorials/pBv0/how-to-perform-cone-shaped-traces-in-unreal-engine | |
| // CollisionLibrary.h | |
| public: | |
| UFUNCTION(BlueprintCallable, Category = "Collision", Meta = (bIgnoreSelf = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm = "ActorsToIgnore", DisplayName = "Multi Cone Trace By Channel", AdvancedDisplay = "TraceColor, TraceHitColor, DrawTime", Keywords = "sweep")) | |
| static bool ConeTraceMulti(const UObject* WorldContextObject, const FVector Start, const FRotator Direction, float ConeHeight, float ConeHalfAngle, ETraceTypeQuery TraceChannel, bool bTraceComplex, const TArray<AActor*>& ActorsToIgnore, EDrawDebugTrace::Type DrawDebugType, TArray<FHitResult>& OutHits, bool bIgnoreSelf, FLinearColor TraceColor = FLinearColor::Red, FLinearColor TraceHitColor = FLinearColor::Green, float DrawTime = 5.0f); | |
| // CollisionLibrary.cpp | |
| bool UCollisionLibrary::ConeTraceMulti( | |
| const UObject* WorldContextObject, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.minecraft.world.entity; | |
| public enum EnumMoveType { | |
| a, // Piston: A player being pushed by a piston | |
| b, // Player: Pushed by another player by collision | |
| c, // Self: Moving using keyboard controls, (i.e. WASD + Spacebar) | |
| d, // Shulker: Being pushed by the shulkers extending body when it peeks | |
| e; // Shulker_Box: Similarly to Shulker, being pushed by the extended block part. | |
| private EnumMoveType() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CustomPathfinder extends PathfinderGoal | |
| boolean a(); //condition to start the whole pathfinder. | |
| boolean b(); //condition to continue after call of e (you can also say call e() again) | |
| void c(); //only called once at the beginning like a onStart | |
| void d(); // same as c() but as an onEnd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.netty.channel.*; | |
| import net.minecraft.network.protocol.game.PacketPlayInUseEntity; | |
| import org.bukkit.Bukkit; | |
| import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer; | |
| import org.bukkit.entity.Player; | |
| import org.bukkit.event.EventHandler; | |
| import org.bukkit.event.Listener; | |
| import org.bukkit.event.player.PlayerJoinEvent; | |
| import org.bukkit.event.player.PlayerQuitEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NPCUtils { | |
| public EntityPlayer createNPC(Location location, String npcName, String texture, String signature) { | |
| MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer(); | |
| WorldServer nmsWorld = ((CraftWorld) location.getWorld()).getHandle(); | |
| GameProfile gameProfile = new GameProfile(UUID.randomUUID(), npcName); | |
| Property property = new Property("textures", texture, signature); | |
| gameProfile.getProperties().put("textures", property); | |
| EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile); | |
| npc.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); | |
| npc.displayName = npcName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Utils; | |
| import net.minecraft.network.chat.IChatBaseComponent; | |
| import net.minecraft.network.protocol.game.PacketPlayOutScoreboardDisplayObjective; | |
| import net.minecraft.network.protocol.game.PacketPlayOutScoreboardObjective; | |
| import net.minecraft.network.protocol.game.PacketPlayOutScoreboardScore; | |
| import net.minecraft.server.ScoreboardServer; | |
| import net.minecraft.server.network.PlayerConnection; | |
| import net.minecraft.world.scores.ScoreboardObjective; | |
| import net.minecraft.world.scores.criteria.IScoreboardCriteria; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Utils; | |
| import Data.Core; | |
| import Data.PlayerCoreData; | |
| import Main.main; | |
| import org.bukkit.Bukkit; | |
| import org.bukkit.Location; | |
| import org.bukkit.Particle; | |
| import org.bukkit.craftbukkit.libs.org.eclipse.sisu.Nullable; | |
| import org.bukkit.entity.Player; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package KeyBinds; | |
| import Data.Constants; | |
| import Data.PlayerCoreData; | |
| import Main.main; | |
| import net.minecraft.network.protocol.game.PacketPlayOutSetSlot; | |
| import net.minecraft.server.network.PlayerConnection; | |
| import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer; | |
| import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack; | |
| import org.bukkit.entity.Player; |