mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-11-21 11:46:46 +01:00
Fixed issues with placing blocks next to the loaders (No solution in 1.7) (#37)
This commit is contained in:
parent
27566f5e04
commit
dbf47ce159
@ -4,6 +4,7 @@ import com.bgsoftware.wildloaders.api.npc.ChunkLoaderNPC;
|
||||
import com.bgsoftware.wildloaders.handlers.NPCHandler;
|
||||
import com.bgsoftware.wildloaders.npc.DummyChannel;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.v1_12_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_12_R1.DamageSource;
|
||||
import net.minecraft.server.v1_12_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_12_R1.EnumGamemode;
|
||||
@ -32,6 +33,8 @@ import java.util.UUID;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_12_R1 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
public ChunkLoaderNPC_v1_12_R1(Location location, UUID uuid){
|
||||
super(((CraftServer) Bukkit.getServer()).getServer(),
|
||||
((CraftWorld) location.getWorld()).getHandle(),
|
||||
@ -48,6 +51,8 @@ public final class ChunkLoaderNPC_v1_12_R1 extends EntityPlayer implements Chunk
|
||||
|
||||
world.players.add(this);
|
||||
((WorldServer) world).getPlayerChunkMap().addPlayer(this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,6 +60,11 @@ public final class ChunkLoaderNPC_v1_12_R1 extends EntityPlayer implements Chunk
|
||||
return super.getUniqueID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
|
@ -4,6 +4,7 @@ import com.bgsoftware.wildloaders.api.npc.ChunkLoaderNPC;
|
||||
import com.bgsoftware.wildloaders.handlers.NPCHandler;
|
||||
import com.bgsoftware.wildloaders.npc.DummyChannel;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.v1_16_R3.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_16_R3.Chunk;
|
||||
import net.minecraft.server.v1_16_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_16_R3.EnumGamemode;
|
||||
@ -32,6 +33,8 @@ import java.util.UUID;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_16_R3 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
private boolean dieCall = false;
|
||||
|
||||
public ChunkLoaderNPC_v1_16_R3(Location location, UUID uuid) {
|
||||
@ -51,6 +54,8 @@ public final class ChunkLoaderNPC_v1_16_R3 extends EntityPlayer implements Chunk
|
||||
setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
|
||||
((WorldServer) world).addPlayerJoin(this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,6 +63,11 @@ public final class ChunkLoaderNPC_v1_16_R3 extends EntityPlayer implements Chunk
|
||||
return super.getUniqueID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
if (!dieCall) {
|
||||
|
@ -22,6 +22,7 @@ import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.server.network.PlayerConnection;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
|
||||
@ -29,6 +30,8 @@ import java.util.UUID;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_17_R1 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
private static final ReflectMethod<Void> SET_GAMEMODE = new ReflectMethod<>(PlayerInteractManager.class,
|
||||
1, EnumGamemode.class, EnumGamemode.class);
|
||||
|
||||
@ -49,6 +52,8 @@ public final class ChunkLoaderNPC_v1_17_R1 extends EntityPlayer implements Chunk
|
||||
setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
|
||||
((WorldServer) getWorld()).addPlayerJoin(this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,6 +61,11 @@ public final class ChunkLoaderNPC_v1_17_R1 extends EntityPlayer implements Chunk
|
||||
return super.getUniqueID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB cs() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Entity.RemovalReason removalReason) {
|
||||
if(!dieCall) {
|
||||
|
@ -19,6 +19,7 @@ import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.server.network.PlayerConnection;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
|
||||
|
||||
@ -28,6 +29,8 @@ import static com.bgsoftware.wildloaders.nms.NMSMappings_v1_18_R1.*;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_18_R1 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
private boolean dieCall = false;
|
||||
|
||||
public ChunkLoaderNPC_v1_18_R1(MinecraftServer minecraftServer, Location location, UUID uuid){
|
||||
@ -45,6 +48,8 @@ public final class ChunkLoaderNPC_v1_18_R1 extends EntityPlayer implements Chunk
|
||||
setLocation(this, location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
|
||||
addPlayerJoin(getWorldServer(this), this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,6 +62,11 @@ public final class ChunkLoaderNPC_v1_18_R1 extends EntityPlayer implements Chunk
|
||||
ah();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB cx() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(RemovalReason removalReason) {
|
||||
if(!dieCall) {
|
||||
|
@ -19,6 +19,7 @@ import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.server.network.PlayerConnection;
|
||||
import net.minecraft.world.level.EnumGamemode;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
|
||||
|
||||
@ -28,6 +29,8 @@ import static com.bgsoftware.wildloaders.nms.NMSMappings_v1_18_R2.*;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_18_R2 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
private boolean dieCall = false;
|
||||
|
||||
public ChunkLoaderNPC_v1_18_R2(MinecraftServer minecraftServer, Location location, UUID uuid){
|
||||
@ -45,6 +48,8 @@ public final class ChunkLoaderNPC_v1_18_R2 extends EntityPlayer implements Chunk
|
||||
setLocation(this, location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
|
||||
addPlayerJoin(getWorldServer(this), this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,6 +62,11 @@ public final class ChunkLoaderNPC_v1_18_R2 extends EntityPlayer implements Chunk
|
||||
ah();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB cx() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(RemovalReason removalReason) {
|
||||
if(!dieCall) {
|
||||
|
@ -4,6 +4,7 @@ import com.bgsoftware.wildloaders.api.npc.ChunkLoaderNPC;
|
||||
import com.bgsoftware.wildloaders.handlers.NPCHandler;
|
||||
import com.bgsoftware.wildloaders.npc.DummyChannel;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_8_R3.DamageSource;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R3.EnumProtocolDirection;
|
||||
@ -32,6 +33,8 @@ import java.util.UUID;
|
||||
|
||||
public final class ChunkLoaderNPC_v1_8_R3 extends EntityPlayer implements ChunkLoaderNPC {
|
||||
|
||||
private static final AxisAlignedBB EMPTY_BOUND = new AxisAlignedBB(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
|
||||
public ChunkLoaderNPC_v1_8_R3(Location location, UUID uuid){
|
||||
super(((CraftServer) Bukkit.getServer()).getServer(),
|
||||
((CraftWorld) location.getWorld()).getHandle(),
|
||||
@ -56,6 +59,8 @@ public final class ChunkLoaderNPC_v1_8_R3 extends EntityPlayer implements ChunkL
|
||||
|
||||
world.players.add(this);
|
||||
((WorldServer) world).getPlayerChunkMap().addPlayer(this);
|
||||
|
||||
super.a(EMPTY_BOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,6 +68,11 @@ public final class ChunkLoaderNPC_v1_8_R3 extends EntityPlayer implements ChunkL
|
||||
return super.getUniqueID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
return EMPTY_BOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
super.die();
|
||||
|
Loading…
Reference in New Issue
Block a user