geforkt von Mirrors/Paper
Update to Minecraft 1.18.2
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
bd40300a4f
Commit
9ee989ea81
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/commands/CommandDispatcher.java
|
--- a/net/minecraft/commands/CommandDispatcher.java
|
||||||
+++ b/net/minecraft/commands/CommandDispatcher.java
|
+++ b/net/minecraft/commands/CommandDispatcher.java
|
||||||
@@ -106,6 +106,14 @@
|
@@ -107,6 +107,14 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import com.google.common.base.Joiner;
|
+import com.google.common.base.Joiner;
|
||||||
@ -14,8 +14,8 @@
|
|||||||
+
|
+
|
||||||
public class CommandDispatcher {
|
public class CommandDispatcher {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -117,6 +125,7 @@
|
@@ -118,6 +126,7 @@
|
||||||
private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> dispatcher = new com.mojang.brigadier.CommandDispatcher();
|
private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> dispatcher = new com.mojang.brigadier.CommandDispatcher();
|
||||||
|
|
||||||
public CommandDispatcher(CommandDispatcher.ServerType commanddispatcher_servertype) {
|
public CommandDispatcher(CommandDispatcher.ServerType commanddispatcher_servertype) {
|
||||||
@ -23,12 +23,12 @@
|
|||||||
CommandAdvancement.register(this.dispatcher);
|
CommandAdvancement.register(this.dispatcher);
|
||||||
CommandAttribute.register(this.dispatcher);
|
CommandAttribute.register(this.dispatcher);
|
||||||
CommandExecute.register(this.dispatcher);
|
CommandExecute.register(this.dispatcher);
|
||||||
@@ -202,17 +211,63 @@
|
@@ -204,17 +213,63 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatcher.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
|
this.dispatcher.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
|
||||||
- CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.dispatcher.getPath(commandnode1), this.dispatcher.getPath(commandnode2), collection);
|
- CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", new Object[]{this.dispatcher.getPath(commandnode1), this.dispatcher.getPath(commandnode2), collection});
|
||||||
+ // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.dispatcher.getPath(commandnode1), this.dispatcher.getPath(commandnode2), collection); // CraftBukkit
|
+ // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", new Object[]{this.dispatcher.getPath(commandnode1), this.dispatcher.getPath(commandnode2), collection}); // CraftBukkit
|
||||||
});
|
});
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ }
|
+ }
|
||||||
@ -89,7 +89,7 @@
|
|||||||
stringreader.skip();
|
stringreader.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +291,7 @@
|
@@ -238,7 +293,7 @@
|
||||||
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
|
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
|
||||||
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
|
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
|
||||||
IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("")).withStyle(EnumChatFormat.GRAY).withStyle((chatmodifier) -> {
|
IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("")).withStyle(EnumChatFormat.GRAY).withStyle((chatmodifier) -> {
|
||||||
@ -98,7 +98,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (j > 10) {
|
if (j > 10) {
|
||||||
@@ -286,11 +341,36 @@
|
@@ -288,11 +343,36 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendCommands(EntityPlayer entityplayer) {
|
public void sendCommands(EntityPlayer entityplayer) {
|
||||||
@ -136,7 +136,7 @@
|
|||||||
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
|
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,7 +381,7 @@
|
@@ -303,7 +383,7 @@
|
||||||
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
|
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
|
||||||
|
|
||||||
if (commandnode2.canUse(commandlistenerwrapper)) {
|
if (commandnode2.canUse(commandlistenerwrapper)) {
|
||||||
@ -145,7 +145,7 @@
|
|||||||
|
|
||||||
argumentbuilder.requires((icompletionprovider) -> {
|
argumentbuilder.requires((icompletionprovider) -> {
|
||||||
return true;
|
return true;
|
||||||
@@ -324,7 +404,7 @@
|
@@ -326,7 +406,7 @@
|
||||||
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
|
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.NIL_UUID);
|
entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.NIL_UUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,4 +296,10 @@
|
@@ -287,4 +304,10 @@
|
||||||
public IRegistryCustom registryAccess() {
|
public IRegistryCustom registryAccess() {
|
||||||
return this.server.registryAccess();
|
return this.server.registryAccess();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
private final Map<String, String> vagueProperties = Maps.newHashMap();
|
||||||
private MinecraftKey id = new MinecraftKey("");
|
private MinecraftKey id = new MinecraftKey("");
|
||||||
private BlockStateList<Block, IBlockData> definition;
|
private BlockStateList<Block, IBlockData> definition;
|
||||||
@@ -237,7 +237,7 @@
|
@@ -230,7 +230,7 @@
|
||||||
Iterator iterator = iblockstate.getPossibleValues().iterator();
|
Iterator iterator = iblockstate.getPossibleValues().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
if (t0 instanceof Integer) {
|
if (t0 instanceof Integer) {
|
||||||
suggestionsbuilder.suggest((Integer) t0);
|
suggestionsbuilder.suggest((Integer) t0);
|
||||||
@@ -506,7 +506,7 @@
|
@@ -493,7 +493,7 @@
|
||||||
Optional<T> optional = iblockstate.getValue(s);
|
Optional<T> optional = iblockstate.getValue(s);
|
||||||
|
|
||||||
if (optional.isPresent()) {
|
if (optional.isPresent()) {
|
||||||
@ -27,7 +27,7 @@
|
|||||||
this.properties.put(iblockstate, (Comparable) optional.get());
|
this.properties.put(iblockstate, (Comparable) optional.get());
|
||||||
} else {
|
} else {
|
||||||
this.reader.setCursor(i);
|
this.reader.setCursor(i);
|
||||||
@@ -540,7 +540,7 @@
|
@@ -527,7 +527,7 @@
|
||||||
private static <T extends Comparable<T>> void appendProperty(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
|
private static <T extends Comparable<T>> void appendProperty(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
|
||||||
stringbuilder.append(iblockstate.getName());
|
stringbuilder.append(iblockstate.getName());
|
||||||
stringbuilder.append('=');
|
stringbuilder.append('=');
|
||||||
@ -35,4 +35,4 @@
|
|||||||
+ stringbuilder.append(iblockstate.getName((T) comparable)); // CraftBukkit - decompile error
|
+ stringbuilder.append(iblockstate.getName((T) comparable)); // CraftBukkit - decompile error
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Suggestions> fillSuggestions(SuggestionsBuilder suggestionsbuilder, Tags<Block> tags) {
|
public CompletableFuture<Suggestions> fillSuggestions(SuggestionsBuilder suggestionsbuilder, IRegistry<Block> iregistry) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
--- a/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
||||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
+++ b/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
|
||||||
@@ -10,6 +10,11 @@
|
@@ -9,6 +9,11 @@
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.BlockDispenser;
|
import net.minecraft.world.level.block.BlockDispenser;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
public class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
||||||
|
|
||||||
private final DispenseBehaviorItem defaultDispenseItemBehavior = new DispenseBehaviorItem();
|
private final DispenseBehaviorItem defaultDispenseItemBehavior = new DispenseBehaviorItem();
|
||||||
@@ -39,12 +44,40 @@
|
@@ -38,12 +43,40 @@
|
||||||
d3 = 0.0D;
|
d3 = 0.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
--- a/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
||||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShears.java
|
||||||
@@ -24,6 +24,12 @@
|
@@ -23,6 +23,12 @@
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
public class DispenseBehaviorShears extends DispenseBehaviorMaybe {
|
public class DispenseBehaviorShears extends DispenseBehaviorMaybe {
|
||||||
|
|
||||||
public DispenseBehaviorShears() {}
|
public DispenseBehaviorShears() {}
|
||||||
@@ -31,11 +37,34 @@
|
@@ -30,11 +36,34 @@
|
||||||
@Override
|
@Override
|
||||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
@ -49,7 +49,7 @@
|
|||||||
if (this.isSuccess() && itemstack.hurt(1, worldserver.getRandom(), (EntityPlayer) null)) {
|
if (this.isSuccess() && itemstack.hurt(1, worldserver.getRandom(), (EntityPlayer) null)) {
|
||||||
itemstack.setCount(0);
|
itemstack.setCount(0);
|
||||||
}
|
}
|
||||||
@@ -62,7 +91,7 @@
|
@@ -63,7 +92,7 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@
|
|||||||
List<EntityLiving> list = worldserver.getEntitiesOfClass(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.NO_SPECTATORS);
|
List<EntityLiving> list = worldserver.getEntitiesOfClass(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.NO_SPECTATORS);
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
@@ -73,6 +102,11 @@
|
@@ -74,6 +103,11 @@
|
||||||
IShearable ishearable = (IShearable) entityliving;
|
IShearable ishearable = (IShearable) entityliving;
|
||||||
|
|
||||||
if (ishearable.readyForShearing()) {
|
if (ishearable.readyForShearing()) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
--- a/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
||||||
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
+++ b/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
|
||||||
@@ -11,6 +11,11 @@
|
@@ -11,6 +11,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.block.BlockDispenser;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
@ -11,7 +11,7 @@
|
|||||||
+
|
+
|
||||||
public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe {
|
public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -27,6 +32,30 @@
|
@@ -27,6 +32,30 @@
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||||
EnumDirection enumdirection1 = isourceblock.getLevel().isEmptyBlock(blockposition.below()) ? enumdirection : EnumDirection.UP;
|
EnumDirection enumdirection1 = isourceblock.getLevel().isEmptyBlock(blockposition.below()) ? enumdirection : EnumDirection.UP;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/core/dispenser/IDispenseBehavior.java
|
--- a/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||||
+++ b/net/minecraft/core/dispenser/IDispenseBehavior.java
|
+++ b/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||||
@@ -76,6 +76,21 @@
|
@@ -75,6 +75,21 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.item.ItemBucket;
|
+import net.minecraft.world.item.ItemBucket;
|
||||||
@ -21,8 +21,8 @@
|
|||||||
+
|
+
|
||||||
public interface IDispenseBehavior {
|
public interface IDispenseBehavior {
|
||||||
|
|
||||||
Logger LOGGER = LogManager.getLogger();
|
Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -200,14 +215,42 @@
|
@@ -199,14 +214,42 @@
|
||||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||||
EntityTypes entitytypes = ((ItemMonsterEgg) itemstack.getItem()).getType(itemstack.getTag());
|
EntityTypes entitytypes = ((ItemMonsterEgg) itemstack.getItem()).getType(itemstack.getTag());
|
||||||
|
|
||||||
@ -67,7 +67,7 @@
|
|||||||
isourceblock.getLevel().gameEvent(GameEvent.ENTITY_PLACE, isourceblock.getPos());
|
isourceblock.getLevel().gameEvent(GameEvent.ENTITY_PLACE, isourceblock.getPos());
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@@ -226,12 +269,40 @@
|
@@ -225,12 +268,40 @@
|
||||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
@ -109,7 +109,7 @@
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -250,8 +321,35 @@
|
@@ -249,8 +320,35 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
@ -146,7 +146,7 @@
|
|||||||
this.setSuccess(true);
|
this.setSuccess(true);
|
||||||
return itemstack;
|
return itemstack;
|
||||||
} else {
|
} else {
|
||||||
@@ -278,7 +376,35 @@
|
@@ -277,7 +375,35 @@
|
||||||
entityhorseabstract = (EntityHorseAbstract) iterator1.next();
|
entityhorseabstract = (EntityHorseAbstract) iterator1.next();
|
||||||
} while (!entityhorseabstract.isArmor(itemstack) || entityhorseabstract.isWearingArmor() || !entityhorseabstract.isTamed());
|
} while (!entityhorseabstract.isArmor(itemstack) || entityhorseabstract.isWearingArmor() || !entityhorseabstract.isTamed());
|
||||||
|
|
||||||
@ -183,7 +183,7 @@
|
|||||||
this.setSuccess(true);
|
this.setSuccess(true);
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@@ -321,9 +447,35 @@
|
@@ -320,9 +446,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entityhorsechestedabstract = (EntityHorseChestedAbstract) iterator1.next();
|
entityhorsechestedabstract = (EntityHorseChestedAbstract) iterator1.next();
|
||||||
@ -221,7 +221,7 @@
|
|||||||
this.setSuccess(true);
|
this.setSuccess(true);
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@@ -332,12 +484,41 @@
|
@@ -331,12 +483,41 @@
|
||||||
@Override
|
@Override
|
||||||
public ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
public ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||||
@ -264,7 +264,7 @@
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,12 +540,40 @@
|
@@ -358,12 +539,40 @@
|
||||||
double d3 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepX();
|
double d3 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepX();
|
||||||
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepY();
|
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepY();
|
||||||
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepZ();
|
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepZ();
|
||||||
@ -310,7 +310,7 @@
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,9 +597,52 @@
|
@@ -387,9 +596,52 @@
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
|
|
||||||
@ -364,7 +364,7 @@
|
|||||||
} else {
|
} else {
|
||||||
return this.defaultDispenseItemBehavior.dispense(isourceblock, itemstack);
|
return this.defaultDispenseItemBehavior.dispense(isourceblock, itemstack);
|
||||||
}
|
}
|
||||||
@@ -416,7 +668,7 @@
|
@@ -415,7 +667,7 @@
|
||||||
Block block = iblockdata.getBlock();
|
Block block = iblockdata.getBlock();
|
||||||
|
|
||||||
if (block instanceof IFluidSource) {
|
if (block instanceof IFluidSource) {
|
||||||
@ -373,7 +373,7 @@
|
|||||||
|
|
||||||
if (itemstack1.isEmpty()) {
|
if (itemstack1.isEmpty()) {
|
||||||
return super.execute(isourceblock, itemstack);
|
return super.execute(isourceblock, itemstack);
|
||||||
@@ -424,6 +676,32 @@
|
@@ -423,6 +675,32 @@
|
||||||
worldserver.gameEvent((Entity) null, GameEvent.FLUID_PICKUP, blockposition);
|
worldserver.gameEvent((Entity) null, GameEvent.FLUID_PICKUP, blockposition);
|
||||||
Item item = itemstack1.getItem();
|
Item item = itemstack1.getItem();
|
||||||
|
|
||||||
@ -406,7 +406,7 @@
|
|||||||
itemstack.shrink(1);
|
itemstack.shrink(1);
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
return new ItemStack(item);
|
return new ItemStack(item);
|
||||||
@@ -445,14 +723,42 @@
|
@@ -444,14 +722,42 @@
|
||||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
|
|
||||||
@ -451,7 +451,7 @@
|
|||||||
} else if (!BlockCampfire.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
|
} else if (!BlockCampfire.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
|
||||||
if (iblockdata.getBlock() instanceof BlockTNT) {
|
if (iblockdata.getBlock() instanceof BlockTNT) {
|
||||||
BlockTNT.explode(worldserver, blockposition);
|
BlockTNT.explode(worldserver, blockposition);
|
||||||
@@ -478,12 +784,62 @@
|
@@ -477,12 +783,62 @@
|
||||||
this.setSuccess(true);
|
this.setSuccess(true);
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||||
@ -514,7 +514,7 @@
|
|||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@@ -493,12 +849,41 @@
|
@@ -492,12 +848,41 @@
|
||||||
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
protected ItemStack execute(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||||
WorldServer worldserver = isourceblock.getLevel();
|
WorldServer worldserver = isourceblock.getLevel();
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||||
@ -558,7 +558,7 @@
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -522,6 +907,30 @@
|
@@ -521,6 +906,30 @@
|
||||||
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING);
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
BlockPosition blockposition = isourceblock.getPos().relative(enumdirection);
|
||||||
|
|
||||||
@ -589,7 +589,7 @@
|
|||||||
if (worldserver.isEmptyBlock(blockposition) && BlockWitherSkull.canSpawnMob(worldserver, blockposition, itemstack)) {
|
if (worldserver.isEmptyBlock(blockposition) && BlockWitherSkull.canSpawnMob(worldserver, blockposition, itemstack)) {
|
||||||
worldserver.setBlock(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.defaultBlockState().setValue(BlockSkull.ROTATION, enumdirection.getAxis() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.getOpposite().get2DDataValue() * 4), 3);
|
worldserver.setBlock(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.defaultBlockState().setValue(BlockSkull.ROTATION, enumdirection.getAxis() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.getOpposite().get2DDataValue() * 4), 3);
|
||||||
worldserver.gameEvent((Entity) null, GameEvent.BLOCK_PLACE, blockposition);
|
worldserver.gameEvent((Entity) null, GameEvent.BLOCK_PLACE, blockposition);
|
||||||
@@ -547,6 +956,30 @@
|
@@ -546,6 +955,30 @@
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||||
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
||||||
|
|
||||||
@ -620,7 +620,7 @@
|
|||||||
if (worldserver.isEmptyBlock(blockposition) && blockpumpkincarved.canSpawnGolem(worldserver, blockposition)) {
|
if (worldserver.isEmptyBlock(blockposition) && blockpumpkincarved.canSpawnGolem(worldserver, blockposition)) {
|
||||||
if (!worldserver.isClientSide) {
|
if (!worldserver.isClientSide) {
|
||||||
worldserver.setBlock(blockposition, blockpumpkincarved.defaultBlockState(), 3);
|
worldserver.setBlock(blockposition, blockpumpkincarved.defaultBlockState(), 3);
|
||||||
@@ -596,6 +1029,30 @@
|
@@ -595,6 +1028,30 @@
|
||||||
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getPos().relative((EnumDirection) isourceblock.getBlockState().getValue(BlockDispenser.FACING));
|
||||||
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
||||||
|
|
||||||
@ -649,5 +649,5 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
if (iblockdata.is(TagsBlock.BEEHIVES, (blockbase_blockdata) -> {
|
if (iblockdata.is(TagsBlock.BEEHIVES, (blockbase_blockdata) -> {
|
||||||
return blockbase_blockdata.hasProperty(BlockBeehive.HONEY_LEVEL);
|
return blockbase_blockdata.hasProperty(BlockBeehive.HONEY_LEVEL) && blockbase_blockdata.getBlock() instanceof BlockBeehive;
|
||||||
}) && (Integer) iblockdata.getValue(BlockBeehive.HONEY_LEVEL) >= 5) {
|
}) && (Integer) iblockdata.getValue(BlockBeehive.HONEY_LEVEL) >= 5) {
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
+// mc-dev import
|
+// mc-dev import
|
||||||
package net.minecraft.nbt;
|
package net.minecraft.nbt;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedOutputStream;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/network/NetworkManager.java
|
--- a/net/minecraft/network/NetworkManager.java
|
||||||
+++ b/net/minecraft/network/NetworkManager.java
|
+++ b/net/minecraft/network/NetworkManager.java
|
||||||
@@ -156,7 +156,7 @@
|
@@ -168,7 +168,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T extends PacketListener> void genericsFtw(Packet<T> packet, PacketListener packetlistener) {
|
private static <T extends PacketListener> void genericsFtw(Packet<T> packet, PacketListener packetlistener) {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setListener(PacketListener packetlistener) {
|
public void setListener(PacketListener packetlistener) {
|
||||||
@@ -268,7 +268,7 @@
|
@@ -280,7 +280,7 @@
|
||||||
|
|
||||||
public void disconnect(IChatBaseComponent ichatbasecomponent) {
|
public void disconnect(IChatBaseComponent ichatbasecomponent) {
|
||||||
if (this.channel.isOpen()) {
|
if (this.channel.isOpen()) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
--- a/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
||||||
+++ b/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
+++ b/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
||||||
@@ -7,6 +7,11 @@
|
@@ -7,6 +7,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.util.thread.IAsyncTaskHandler;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.server.MinecraftServer;
|
+import net.minecraft.server.MinecraftServer;
|
||||||
@ -11,16 +11,16 @@
|
|||||||
+
|
+
|
||||||
public class PlayerConnectionUtils {
|
public class PlayerConnectionUtils {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -20,6 +25,7 @@
|
@@ -20,6 +25,7 @@
|
||||||
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
|
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
|
||||||
if (!iasynctaskhandler.isSameThread()) {
|
if (!iasynctaskhandler.isSameThread()) {
|
||||||
iasynctaskhandler.execute(() -> {
|
iasynctaskhandler.executeIfPossible(() -> {
|
||||||
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
|
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
|
||||||
if (t0.getConnection().isConnected()) {
|
if (t0.getConnection().isConnected()) {
|
||||||
|
try {
|
||||||
packet.handle(t0);
|
packet.handle(t0);
|
||||||
} else {
|
@@ -36,6 +42,10 @@
|
||||||
@@ -28,6 +34,10 @@
|
|
||||||
|
|
||||||
});
|
});
|
||||||
throw CancelledPacketHandleException.RUNNING_ON_DIFFERENT_THREAD;
|
throw CancelledPacketHandleException.RUNNING_ON_DIFFERENT_THREAD;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/DispenserRegistry.java
|
--- a/net/minecraft/server/DispenserRegistry.java
|
||||||
+++ b/net/minecraft/server/DispenserRegistry.java
|
+++ b/net/minecraft/server/DispenserRegistry.java
|
||||||
@@ -34,6 +34,12 @@
|
@@ -33,6 +33,12 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.util.datafix.fixes.DataConverterFlattenData;
|
+import net.minecraft.util.datafix.fixes.DataConverterFlattenData;
|
||||||
@ -13,7 +13,7 @@
|
|||||||
public class DispenserRegistry {
|
public class DispenserRegistry {
|
||||||
|
|
||||||
public static final PrintStream STDOUT = System.out;
|
public static final PrintStream STDOUT = System.out;
|
||||||
@@ -44,6 +50,23 @@
|
@@ -43,6 +49,23 @@
|
||||||
|
|
||||||
public static void bootStrap() {
|
public static void bootStrap() {
|
||||||
if (!DispenserRegistry.isBootstrapped) {
|
if (!DispenserRegistry.isBootstrapped) {
|
||||||
@ -37,8 +37,8 @@
|
|||||||
DispenserRegistry.isBootstrapped = true;
|
DispenserRegistry.isBootstrapped = true;
|
||||||
if (IRegistry.REGISTRY.keySet().isEmpty()) {
|
if (IRegistry.REGISTRY.keySet().isEmpty()) {
|
||||||
throw new IllegalStateException("Unable to load registries");
|
throw new IllegalStateException("Unable to load registries");
|
||||||
@@ -61,6 +84,69 @@
|
@@ -60,6 +83,69 @@
|
||||||
TagStatic.bootStrap();
|
IRegistry.freezeBuiltins();
|
||||||
wrapStreams();
|
wrapStreams();
|
||||||
}
|
}
|
||||||
+ // CraftBukkit start - easier than fixing the decompile
|
+ // CraftBukkit start - easier than fixing the decompile
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
--- a/net/minecraft/server/Main.java
|
--- a/net/minecraft/server/Main.java
|
||||||
+++ b/net/minecraft/server/Main.java
|
+++ b/net/minecraft/server/Main.java
|
||||||
@@ -56,6 +56,12 @@
|
@@ -57,6 +57,12 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.storage.WorldInfo;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
|
+import java.util.concurrent.atomic.AtomicReference;
|
||||||
+import net.minecraft.SharedConstants;
|
+import net.minecraft.SharedConstants;
|
||||||
+import net.minecraft.world.level.dimension.DimensionManager;
|
|
||||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||||
+// CraftBukkit end
|
+// CraftBukkit end
|
||||||
+
|
+
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
private static final Logger LOGGER;
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -63,8 +69,9 @@
|
@@ -64,8 +70,9 @@
|
||||||
public Main() {}
|
public Main() {}
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@ -24,7 +24,7 @@
|
|||||||
OptionParser optionparser = new OptionParser();
|
OptionParser optionparser = new OptionParser();
|
||||||
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
|
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
|
||||||
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
|
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
|
||||||
@@ -89,9 +96,12 @@
|
@@ -90,9 +97,12 @@
|
||||||
optionparser.printHelpOn(System.err);
|
optionparser.printHelpOn(System.err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -39,8 +39,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,13 +110,13 @@
|
@@ -100,13 +110,13 @@
|
||||||
|
DispenserRegistry.validate();
|
||||||
SystemUtils.startTimerHackThread();
|
SystemUtils.startTimerHackThread();
|
||||||
IRegistryCustom.Dimension iregistrycustom_dimension = IRegistryCustom.builtin();
|
|
||||||
Path path = Paths.get("server.properties");
|
Path path = Paths.get("server.properties");
|
||||||
- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path);
|
- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path);
|
||||||
+ DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
|
+ DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
|
||||||
@ -73,10 +73,10 @@
|
|||||||
WorldInfo worldinfo = convertable_conversionsession.getSummary();
|
WorldInfo worldinfo = convertable_conversionsession.getSummary();
|
||||||
|
|
||||||
if (worldinfo != null) {
|
if (worldinfo != null) {
|
||||||
@@ -139,13 +150,30 @@
|
@@ -138,13 +149,32 @@
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DataPackConfiguration datapackconfiguration = convertable_conversionsession.getDataPacks();
|
|
||||||
- boolean flag = optionset.has(optionspec6);
|
- boolean flag = optionset.has(optionspec6);
|
||||||
+ boolean flag = optionset.has("safeMode");
|
+ boolean flag = optionset.has("safeMode");
|
||||||
|
|
||||||
@ -101,26 +101,49 @@
|
|||||||
+ } catch (java.io.IOException ex) {
|
+ } catch (java.io.IOException ex) {
|
||||||
+ throw new RuntimeException("Could not initialize Bukkit datapack", ex);
|
+ throw new RuntimeException("Could not initialize Bukkit datapack", ex);
|
||||||
+ }
|
+ }
|
||||||
|
+ AtomicReference<DataPackConfiguration> config = new AtomicReference<>();
|
||||||
|
+ AtomicReference<DynamicOps<NBTBase>> ops = new AtomicReference<>();
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
DataPackConfiguration datapackconfiguration1 = MinecraftServer.configurePackRepository(resourcepackrepository, datapackconfiguration == null ? DataPackConfiguration.DEFAULT : datapackconfiguration, flag);
|
|
||||||
CompletableFuture completablefuture = DataPackResources.loadResources(resourcepackrepository.openAllSelected(), iregistrycustom_dimension, CommandDispatcher.ServerType.DEDICATED, dedicatedserversettings.getProperties().functionPermissionLevel, SystemUtils.backgroundExecutor(), Runnable::run);
|
|
||||||
|
|
||||||
@@ -160,6 +188,7 @@
|
WorldStem worldstem;
|
||||||
|
|
||||||
|
@@ -158,6 +188,12 @@
|
||||||
|
}, (iresourcemanager, datapackconfiguration) -> {
|
||||||
|
IRegistryCustom.e iregistrycustom_e = IRegistryCustom.builtinCopy();
|
||||||
|
DynamicOps<NBTBase> dynamicops = RegistryOps.createAndLoad(DynamicOpsNBT.INSTANCE, iregistrycustom_e, iresourcemanager);
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ config.set(datapackconfiguration);
|
||||||
|
+ ops.set(dynamicops);
|
||||||
|
+ return Pair.of(null, iregistrycustom_e.freeze());
|
||||||
|
+ // CraftBukkit end
|
||||||
|
+ /*
|
||||||
|
SaveData savedata = convertable_conversionsession.getDataTag(dynamicops, datapackconfiguration, iregistrycustom_e.allElementsLifecycle());
|
||||||
|
|
||||||
|
if (savedata != null) {
|
||||||
|
@@ -180,6 +216,7 @@
|
||||||
|
|
||||||
|
return Pair.of(worlddataserver, iregistrycustom_e.freeze());
|
||||||
|
}
|
||||||
|
+ */
|
||||||
|
}, SystemUtils.backgroundExecutor(), Runnable::run).get();
|
||||||
|
} catch (Exception exception) {
|
||||||
|
Main.LOGGER.warn("Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode", exception);
|
||||||
|
@@ -188,6 +225,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
datapackresources.updateGlobals();
|
worldstem.updateGlobals();
|
||||||
+ /*
|
+ /*
|
||||||
RegistryReadOps<NBTBase> registryreadops = RegistryReadOps.createAndLoad(DynamicOpsNBT.INSTANCE, datapackresources.getResourceManager(), iregistrycustom_dimension);
|
IRegistryCustom.Dimension iregistrycustom_dimension = worldstem.registryAccess();
|
||||||
|
|
||||||
dedicatedserversettings.getProperties().getWorldGenSettings(iregistrycustom_dimension);
|
dedicatedserversettings.getProperties().getWorldGenSettings(iregistrycustom_dimension);
|
||||||
@@ -189,21 +218,32 @@
|
@@ -200,21 +238,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
convertable_conversionsession.saveDataTag(iregistrycustom_dimension, (SaveData) object);
|
convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata);
|
||||||
+ */
|
+ */
|
||||||
final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
|
final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
|
||||||
- DedicatedServer dedicatedserver1 = new DedicatedServer(thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, object, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
- DedicatedServer dedicatedserver1 = new DedicatedServer(thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
||||||
+ DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
+ DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
||||||
|
|
||||||
+ /*
|
+ /*
|
||||||
dedicatedserver1.setSingleplayerName((String) optionset.valueOf(optionspec8));
|
dedicatedserver1.setSingleplayerName((String) optionset.valueOf(optionspec8));
|
||||||
@ -148,15 +171,15 @@
|
|||||||
Thread thread = new Thread("Server Shutdown Thread") {
|
Thread thread = new Thread("Server Shutdown Thread") {
|
||||||
public void run() {
|
public void run() {
|
||||||
dedicatedserver.halt(true);
|
dedicatedserver.halt(true);
|
||||||
@@ -212,6 +252,7 @@
|
@@ -223,6 +272,7 @@
|
||||||
|
|
||||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
|
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
|
||||||
Runtime.getRuntime().addShutdownHook(thread);
|
Runtime.getRuntime().addShutdownHook(thread);
|
||||||
+ */ // CraftBukkit end
|
+ */ // CraftBukkit end
|
||||||
} catch (Exception exception1) {
|
} catch (Exception exception1) {
|
||||||
Main.LOGGER.fatal("Failed to start the minecraft server", exception1);
|
Main.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", exception1);
|
||||||
}
|
}
|
||||||
@@ -219,7 +260,7 @@
|
@@ -230,7 +280,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forceUpgrade(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, boolean flag, BooleanSupplier booleansupplier, GeneratorSettings generatorsettings) {
|
public static void forceUpgrade(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, boolean flag, BooleanSupplier booleansupplier, GeneratorSettings generatorsettings) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -160,6 +160,27 @@
|
@@ -163,6 +163,26 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.commons.lang3.Validate;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import com.mojang.serialization.DynamicOps;
|
+import com.mojang.serialization.DynamicOps;
|
||||||
@ -11,7 +11,6 @@
|
|||||||
+import joptsimple.OptionSet;
|
+import joptsimple.OptionSet;
|
||||||
+import net.minecraft.nbt.DynamicOpsNBT;
|
+import net.minecraft.nbt.DynamicOpsNBT;
|
||||||
+import net.minecraft.nbt.NBTBase;
|
+import net.minecraft.nbt.NBTBase;
|
||||||
+import net.minecraft.resources.RegistryReadOps;
|
|
||||||
+import net.minecraft.server.dedicated.DedicatedServer;
|
+import net.minecraft.server.dedicated.DedicatedServer;
|
||||||
+import net.minecraft.server.dedicated.DedicatedServerProperties;
|
+import net.minecraft.server.dedicated.DedicatedServerProperties;
|
||||||
+import net.minecraft.util.datafix.DataConverterRegistry;
|
+import net.minecraft.util.datafix.DataConverterRegistry;
|
||||||
@ -27,14 +26,14 @@
|
|||||||
+
|
+
|
||||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements ICommandListener, AutoCloseable {
|
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements ICommandListener, AutoCloseable {
|
||||||
|
|
||||||
public static final Logger LOGGER = LogManager.getLogger();
|
public static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -252,6 +273,21 @@
|
@@ -255,6 +275,21 @@
|
||||||
protected SaveData worldData;
|
protected SaveData worldData;
|
||||||
private volatile boolean isSaving;
|
private volatile boolean isSaving;
|
||||||
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public final DataPackConfiguration datapackconfiguration;
|
+ public final DataPackConfiguration datapackconfiguration;
|
||||||
+ public final RegistryReadOps<NBTBase> registryreadops;
|
+ public final DynamicOps<NBTBase> registryreadops;
|
||||||
+ public org.bukkit.craftbukkit.CraftServer server;
|
+ public org.bukkit.craftbukkit.CraftServer server;
|
||||||
+ public OptionSet options;
|
+ public OptionSet options;
|
||||||
+ public org.bukkit.command.ConsoleCommandSender console;
|
+ public org.bukkit.command.ConsoleCommandSender console;
|
||||||
@ -50,7 +49,7 @@
|
|||||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> function) {
|
public static <S extends MinecraftServer> S spin(Function<Thread, S> function) {
|
||||||
AtomicReference<S> atomicreference = new AtomicReference();
|
AtomicReference<S> atomicreference = new AtomicReference();
|
||||||
Thread thread = new Thread(() -> {
|
Thread thread = new Thread(() -> {
|
||||||
@@ -265,14 +301,14 @@
|
@@ -268,14 +303,14 @@
|
||||||
thread.setPriority(8);
|
thread.setPriority(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,12 +61,12 @@
|
|||||||
return s0;
|
return s0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public MinecraftServer(Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
- public MinecraftServer(Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
||||||
+ public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
+ public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, DynamicOps<NBTBase> registryreadops, Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
||||||
super("Server");
|
super("Server");
|
||||||
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
||||||
this.profiler = this.metricsRecorder.getProfiler();
|
this.profiler = this.metricsRecorder.getProfiler();
|
||||||
@@ -284,7 +320,7 @@
|
@@ -287,7 +322,7 @@
|
||||||
this.status = new ServerPing();
|
this.status = new ServerPing();
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
this.port = -1;
|
this.port = -1;
|
||||||
@ -76,15 +75,15 @@
|
|||||||
this.running = true;
|
this.running = true;
|
||||||
this.tickTimes = new long[100];
|
this.tickTimes = new long[100];
|
||||||
this.resourcePack = "";
|
this.resourcePack = "";
|
||||||
@@ -314,13 +350,41 @@
|
@@ -317,13 +352,41 @@
|
||||||
this.structureManager = new DefinedStructureManager(datapackresources.getResourceManager(), convertable_conversionsession, datafixer);
|
this.structureManager = new DefinedStructureManager(worldstem.resourceManager(), convertable_conversionsession, datafixer);
|
||||||
this.serverThread = thread;
|
this.serverThread = thread;
|
||||||
this.executor = SystemUtils.backgroundExecutor();
|
this.executor = SystemUtils.backgroundExecutor();
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ this.options = options;
|
+ this.options = options;
|
||||||
+ this.datapackconfiguration = datapackconfiguration;
|
+ this.datapackconfiguration = datapackconfiguration;
|
||||||
+ this.registryreadops = RegistryReadOps.createAndLoad(DynamicOpsNBT.INSTANCE, datapackresources.getResourceManager(), iregistrycustom_dimension);
|
+ this.registryreadops = registryreadops;
|
||||||
+ this.vanillaCommandDispatcher = datapackresources.commands; // CraftBukkit
|
+ this.vanillaCommandDispatcher = worldstem.dataPackResources().commands; // CraftBukkit
|
||||||
+ // Try to see if we're actually running in a terminal, disable jline if not
|
+ // Try to see if we're actually running in a terminal, disable jline if not
|
||||||
+ if (System.console() == null && System.getProperty("jline.terminal") == null) {
|
+ if (System.console() == null && System.getProperty("jline.terminal") == null) {
|
||||||
+ System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
|
+ System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
|
||||||
@ -119,7 +118,7 @@
|
|||||||
ScoreboardServer scoreboardserver1 = this.getScoreboard();
|
ScoreboardServer scoreboardserver1 = this.getScoreboard();
|
||||||
|
|
||||||
Objects.requireNonNull(scoreboardserver1);
|
Objects.requireNonNull(scoreboardserver1);
|
||||||
@@ -329,7 +393,7 @@
|
@@ -332,7 +395,7 @@
|
||||||
|
|
||||||
protected abstract boolean initServer() throws IOException;
|
protected abstract boolean initServer() throws IOException;
|
||||||
|
|
||||||
@ -128,7 +127,7 @@
|
|||||||
if (!JvmProfiler.INSTANCE.isRunning()) {
|
if (!JvmProfiler.INSTANCE.isRunning()) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@@ -337,13 +401,8 @@
|
@@ -340,13 +403,8 @@
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
ProfiledDuration profiledduration = JvmProfiler.INSTANCE.onWorldLoadedStarted();
|
ProfiledDuration profiledduration = JvmProfiler.INSTANCE.onWorldLoadedStarted();
|
||||||
|
|
||||||
@ -143,7 +142,7 @@
|
|||||||
if (profiledduration != null) {
|
if (profiledduration != null) {
|
||||||
profiledduration.finish();
|
profiledduration.finish();
|
||||||
}
|
}
|
||||||
@@ -358,36 +417,206 @@
|
@@ -361,36 +419,206 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +151,7 @@
|
|||||||
+ private void loadWorld0(String s) {
|
+ private void loadWorld0(String s) {
|
||||||
+ Convertable.ConversionSession worldSession = this.storageSource;
|
+ Convertable.ConversionSession worldSession = this.storageSource;
|
||||||
+ IRegistryCustom.Dimension iregistrycustom_dimension = this.registryHolder;
|
+ IRegistryCustom.Dimension iregistrycustom_dimension = this.registryHolder;
|
||||||
+ WorldDataServer overworldData = (WorldDataServer) worldSession.getDataTag(registryreadops, datapackconfiguration);
|
+ WorldDataServer overworldData = (WorldDataServer) worldSession.getDataTag(registryreadops, datapackconfiguration, iregistrycustom_dimension.allElementsLifecycle());
|
||||||
+ if (overworldData == null) {
|
+ if (overworldData == null) {
|
||||||
+ WorldSettings worldsettings;
|
+ WorldSettings worldsettings;
|
||||||
+ GeneratorSettings generatorsettings;
|
+ GeneratorSettings generatorsettings;
|
||||||
@ -170,16 +169,16 @@
|
|||||||
- long i = generatorsettings.seed();
|
- long i = generatorsettings.seed();
|
||||||
- long j = BiomeManager.obfuscateSeed(i);
|
- long j = BiomeManager.obfuscateSeed(i);
|
||||||
- List<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver));
|
- List<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver));
|
||||||
- RegistryMaterials<WorldDimension> registrymaterials = generatorsettings.dimensions();
|
- IRegistry<WorldDimension> iregistry = generatorsettings.dimensions();
|
||||||
- WorldDimension worlddimension = (WorldDimension) registrymaterials.get(WorldDimension.OVERWORLD);
|
- WorldDimension worlddimension = (WorldDimension) iregistry.get(WorldDimension.OVERWORLD);
|
||||||
- DimensionManager dimensionmanager;
|
- Holder holder;
|
||||||
- Object object;
|
- Object object;
|
||||||
-
|
-
|
||||||
- if (worlddimension == null) {
|
- if (worlddimension == null) {
|
||||||
- dimensionmanager = (DimensionManager) this.registryHolder.registryOrThrow(IRegistry.DIMENSION_TYPE_REGISTRY).getOrThrow(DimensionManager.OVERWORLD_LOCATION);
|
- holder = this.registryAccess().registryOrThrow(IRegistry.DIMENSION_TYPE_REGISTRY).getOrCreateHolder(DimensionManager.OVERWORLD_LOCATION);
|
||||||
- object = GeneratorSettings.makeDefaultOverworld(this.registryHolder, (new Random()).nextLong());
|
- object = GeneratorSettings.makeDefaultOverworld(this.registryAccess(), (new Random()).nextLong());
|
||||||
- } else {
|
- } else {
|
||||||
- dimensionmanager = worlddimension.type();
|
- holder = worlddimension.typeHolder();
|
||||||
- object = worlddimension.generator();
|
- object = worlddimension.generator();
|
||||||
+ worldsettings = new WorldSettings(dedicatedserverproperties.levelName, dedicatedserverproperties.gamemode, dedicatedserverproperties.hardcore, dedicatedserverproperties.difficulty, false, new GameRules(), datapackconfiguration);
|
+ worldsettings = new WorldSettings(dedicatedserverproperties.levelName, dedicatedserverproperties.gamemode, dedicatedserverproperties.hardcore, dedicatedserverproperties.difficulty, false, new GameRules(), datapackconfiguration);
|
||||||
+ generatorsettings = options.has("bonusChest") ? dedicatedserverproperties.getWorldGenSettings(iregistrycustom_dimension).withBonusChest() : dedicatedserverproperties.getWorldGenSettings(iregistrycustom_dimension);
|
+ generatorsettings = options.has("bonusChest") ? dedicatedserverproperties.getWorldGenSettings(iregistrycustom_dimension).withBonusChest() : dedicatedserverproperties.getWorldGenSettings(iregistrycustom_dimension);
|
||||||
@ -189,9 +188,9 @@
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ GeneratorSettings overworldSettings = overworldData.worldGenSettings();
|
+ GeneratorSettings overworldSettings = overworldData.worldGenSettings();
|
||||||
+ RegistryMaterials<WorldDimension> registrymaterials = overworldSettings.dimensions();
|
+ IRegistry<WorldDimension> iregistry = overworldSettings.dimensions();
|
||||||
+ for (Entry<ResourceKey<WorldDimension>, WorldDimension> entry : registrymaterials.entrySet()) {
|
+ for (WorldDimension worldDimension : iregistry) {
|
||||||
+ ResourceKey<WorldDimension> dimensionKey = entry.getKey();
|
+ ResourceKey<WorldDimension> dimensionKey = iregistry.getResourceKey(worldDimension).get();
|
||||||
+
|
+
|
||||||
+ WorldServer world;
|
+ WorldServer world;
|
||||||
+ int dimension = 0;
|
+ int dimension = 0;
|
||||||
@ -259,7 +258,7 @@
|
|||||||
+ org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
|
+ org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
|
||||||
+ org.bukkit.generator.BiomeProvider biomeProvider = this.server.getBiomeProvider(name);
|
+ org.bukkit.generator.BiomeProvider biomeProvider = this.server.getBiomeProvider(name);
|
||||||
+
|
+
|
||||||
+ WorldDataServer worlddata = (WorldDataServer) worldSession.getDataTag((DynamicOps) registryreadops, datapackconfiguration);
|
+ WorldDataServer worlddata = (WorldDataServer) worldSession.getDataTag((DynamicOps) registryreadops, datapackconfiguration, iregistrycustom_dimension.allElementsLifecycle());
|
||||||
+ if (worlddata == null) {
|
+ if (worlddata == null) {
|
||||||
+ WorldSettings worldsettings;
|
+ WorldSettings worldsettings;
|
||||||
+ GeneratorSettings generatorsettings;
|
+ GeneratorSettings generatorsettings;
|
||||||
@ -289,27 +288,27 @@
|
|||||||
+ long i = generatorsettings.seed();
|
+ long i = generatorsettings.seed();
|
||||||
+ long j = BiomeManager.obfuscateSeed(i);
|
+ long j = BiomeManager.obfuscateSeed(i);
|
||||||
+ List<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver));
|
+ List<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver));
|
||||||
+ WorldDimension worlddimension = (WorldDimension) registrymaterials.get(dimensionKey);
|
+ WorldDimension worlddimension = (WorldDimension) iregistry.get(dimensionKey);
|
||||||
+ DimensionManager dimensionmanager;
|
+ Holder<DimensionManager> holder;
|
||||||
+ ChunkGenerator chunkgenerator;
|
+ ChunkGenerator chunkgenerator;
|
||||||
+
|
+
|
||||||
+ if (worlddimension == null) {
|
+ if (worlddimension == null) {
|
||||||
+ dimensionmanager = (DimensionManager) this.registryHolder.registryOrThrow(IRegistry.DIMENSION_TYPE_REGISTRY).getOrThrow(DimensionManager.OVERWORLD_LOCATION);
|
+ holder = this.registryAccess().registryOrThrow(IRegistry.DIMENSION_TYPE_REGISTRY).getOrCreateHolder(DimensionManager.OVERWORLD_LOCATION);
|
||||||
+ chunkgenerator = GeneratorSettings.makeDefaultOverworld(this.registryHolder, (new Random()).nextLong());
|
+ chunkgenerator = GeneratorSettings.makeDefaultOverworld(this.registryHolder, (new Random()).nextLong());
|
||||||
+ } else {
|
+ } else {
|
||||||
+ dimensionmanager = worlddimension.type();
|
+ holder = worlddimension.typeHolder();
|
||||||
+ chunkgenerator = worlddimension.generator();
|
+ chunkgenerator = worlddimension.generator();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), dimensionmanager);
|
+ org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), holder.value());
|
||||||
+ if (biomeProvider == null && gen != null) {
|
+ if (biomeProvider == null && gen != null) {
|
||||||
+ biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
|
+ biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (biomeProvider != null) {
|
+ if (biomeProvider != null) {
|
||||||
+ WorldChunkManager worldChunkManager = new CustomWorldChunkManager(worldInfo, biomeProvider, registryHolder.ownedRegistryOrThrow(IRegistry.BIOME_REGISTRY));
|
+ WorldChunkManager worldChunkManager = new CustomWorldChunkManager(worldInfo, biomeProvider, registryHolder.ownedRegistryOrThrow(IRegistry.BIOME_REGISTRY));
|
||||||
+ if (chunkgenerator instanceof ChunkGeneratorAbstract) {
|
+ if (chunkgenerator instanceof ChunkGeneratorAbstract cga) {
|
||||||
+ chunkgenerator = new ChunkGeneratorAbstract(((ChunkGeneratorAbstract) chunkgenerator).noises, worldChunkManager, chunkgenerator.strongholdSeed, ((ChunkGeneratorAbstract) chunkgenerator).settings);
|
+ chunkgenerator = new ChunkGeneratorAbstract(cga.structureSets, cga.noises, worldChunkManager, chunkgenerator.ringPlacementSeed, cga.settings);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -321,14 +320,14 @@
|
|||||||
+
|
+
|
||||||
+ WorldLoadListener worldloadlistener = this.progressListenerFactory.create(11);
|
+ WorldLoadListener worldloadlistener = this.progressListenerFactory.create(11);
|
||||||
+
|
+
|
||||||
+ world = new WorldServer(this, this.executor, worldSession, iworlddataserver, worldKey, dimensionmanager, worldloadlistener, chunkgenerator, flag, j, list, true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
|
+ world = new WorldServer(this, this.executor, worldSession, iworlddataserver, worldKey, holder, worldloadlistener, chunkgenerator, flag, j, list, true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
|
||||||
+ WorldPersistentData worldpersistentdata = world.getDataStorage();
|
+ WorldPersistentData worldpersistentdata = world.getDataStorage();
|
||||||
+ this.readScoreboard(worldpersistentdata);
|
+ this.readScoreboard(worldpersistentdata);
|
||||||
+ this.server.scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(this, world.getScoreboard());
|
+ this.server.scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(this, world.getScoreboard());
|
||||||
+ this.commandStorage = new PersistentCommandStorage(worldpersistentdata);
|
+ this.commandStorage = new PersistentCommandStorage(worldpersistentdata);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ WorldLoadListener worldloadlistener = this.progressListenerFactory.create(11);
|
+ WorldLoadListener worldloadlistener = this.progressListenerFactory.create(11);
|
||||||
+ world = new WorldServer(this, this.executor, worldSession, iworlddataserver, worldKey, dimensionmanager, worldloadlistener, chunkgenerator, flag, j, ImmutableList.of(), true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
|
+ world = new WorldServer(this, this.executor, worldSession, iworlddataserver, worldKey, holder, worldloadlistener, chunkgenerator, flag, j, ImmutableList.of(), true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
+ worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
||||||
@ -348,7 +347,7 @@
|
|||||||
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
||||||
}
|
}
|
||||||
|
|
||||||
- WorldServer worldserver = new WorldServer(this, this.executor, this.storageSource, iworlddataserver, World.OVERWORLD, dimensionmanager, worldloadlistener, (ChunkGenerator) object, flag, j, list, true);
|
- WorldServer worldserver = new WorldServer(this, this.executor, this.storageSource, iworlddataserver, World.OVERWORLD, holder, worldloadlistener, (ChunkGenerator) object, flag, j, list, true);
|
||||||
+ this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
+ this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||||
+ this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
+ this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
||||||
+ this.connection.acceptConnections();
|
+ this.connection.acceptConnections();
|
||||||
@ -374,7 +373,7 @@
|
|||||||
|
|
||||||
if (!iworlddataserver.isInitialized()) {
|
if (!iworlddataserver.isInitialized()) {
|
||||||
try {
|
try {
|
||||||
@@ -411,31 +640,8 @@
|
@@ -414,31 +642,8 @@
|
||||||
iworlddataserver.setInitialized(true);
|
iworlddataserver.setInitialized(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,7 +382,7 @@
|
|||||||
- this.getCustomBossEvents().load(this.worldData.getCustomBossEvents());
|
- this.getCustomBossEvents().load(this.worldData.getCustomBossEvents());
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- Iterator iterator = registrymaterials.entrySet().iterator();
|
- Iterator iterator = iregistry.entrySet().iterator();
|
||||||
-
|
-
|
||||||
- while (iterator.hasNext()) {
|
- while (iterator.hasNext()) {
|
||||||
- Entry<ResourceKey<WorldDimension>, WorldDimension> entry = (Entry) iterator.next();
|
- Entry<ResourceKey<WorldDimension>, WorldDimension> entry = (Entry) iterator.next();
|
||||||
@ -391,10 +390,10 @@
|
|||||||
-
|
-
|
||||||
- if (resourcekey != WorldDimension.OVERWORLD) {
|
- if (resourcekey != WorldDimension.OVERWORLD) {
|
||||||
- ResourceKey<World> resourcekey1 = ResourceKey.create(IRegistry.DIMENSION_REGISTRY, resourcekey.location());
|
- ResourceKey<World> resourcekey1 = ResourceKey.create(IRegistry.DIMENSION_REGISTRY, resourcekey.location());
|
||||||
- DimensionManager dimensionmanager1 = ((WorldDimension) entry.getValue()).type();
|
- Holder<DimensionManager> holder1 = ((WorldDimension) entry.getValue()).typeHolder();
|
||||||
- ChunkGenerator chunkgenerator = ((WorldDimension) entry.getValue()).generator();
|
- ChunkGenerator chunkgenerator = ((WorldDimension) entry.getValue()).generator();
|
||||||
- SecondaryWorldData secondaryworlddata = new SecondaryWorldData(this.worldData, iworlddataserver);
|
- SecondaryWorldData secondaryworlddata = new SecondaryWorldData(this.worldData, iworlddataserver);
|
||||||
- WorldServer worldserver1 = new WorldServer(this, this.executor, this.storageSource, secondaryworlddata, resourcekey1, dimensionmanager1, worldloadlistener, chunkgenerator, flag, j, ImmutableList.of(), false);
|
- WorldServer worldserver1 = new WorldServer(this, this.executor, this.storageSource, secondaryworlddata, resourcekey1, holder1, worldloadlistener, chunkgenerator, flag, j, ImmutableList.of(), false);
|
||||||
-
|
-
|
||||||
- worldborder.addListener(new IWorldBorderListener.a(worldserver1.getWorldBorder()));
|
- worldborder.addListener(new IWorldBorderListener.a(worldserver1.getWorldBorder()));
|
||||||
- this.levels.put(resourcekey1, worldserver1);
|
- this.levels.put(resourcekey1, worldserver1);
|
||||||
@ -407,7 +406,7 @@
|
|||||||
|
|
||||||
private static void setInitialSpawn(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1) {
|
private static void setInitialSpawn(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1) {
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
@@ -443,6 +649,21 @@
|
@@ -446,6 +651,21 @@
|
||||||
} else {
|
} else {
|
||||||
ChunkGenerator chunkgenerator = worldserver.getChunkSource().getGenerator();
|
ChunkGenerator chunkgenerator = worldserver.getChunkSource().getGenerator();
|
||||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(chunkgenerator.climateSampler().findSpawnPosition());
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(chunkgenerator.climateSampler().findSpawnPosition());
|
||||||
@ -429,7 +428,7 @@
|
|||||||
int i = chunkgenerator.getSpawnHeight(worldserver);
|
int i = chunkgenerator.getSpawnHeight(worldserver);
|
||||||
|
|
||||||
if (i < worldserver.getMinBuildHeight()) {
|
if (i < worldserver.getMinBuildHeight()) {
|
||||||
@@ -500,8 +721,15 @@
|
@@ -503,8 +723,15 @@
|
||||||
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
|
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +446,7 @@
|
|||||||
|
|
||||||
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.dimension().location());
|
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.dimension().location());
|
||||||
BlockPosition blockposition = worldserver.getSharedSpawnPos();
|
BlockPosition blockposition = worldserver.getSharedSpawnPos();
|
||||||
@@ -514,16 +742,20 @@
|
@@ -517,16 +744,20 @@
|
||||||
chunkproviderserver.addRegionTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
|
chunkproviderserver.addRegionTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
|
||||||
|
|
||||||
while (chunkproviderserver.getTickingGenerated() != 441) {
|
while (chunkproviderserver.getTickingGenerated() != 441) {
|
||||||
@ -476,7 +475,7 @@
|
|||||||
ForcedChunk forcedchunk = (ForcedChunk) worldserver1.getDataStorage().get(ForcedChunk::load, "chunks");
|
ForcedChunk forcedchunk = (ForcedChunk) worldserver1.getDataStorage().get(ForcedChunk::load, "chunks");
|
||||||
|
|
||||||
if (forcedchunk != null) {
|
if (forcedchunk != null) {
|
||||||
@@ -538,11 +770,18 @@
|
@@ -541,11 +772,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +497,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void detectBundledResources() {
|
protected void detectBundledResources() {
|
||||||
@@ -587,12 +826,16 @@
|
@@ -590,12 +828,16 @@
|
||||||
worldserver.save((IProgressUpdate) null, flag1, worldserver.noSave && !flag2);
|
worldserver.save((IProgressUpdate) null, flag1, worldserver.noSave && !flag2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,13 +508,13 @@
|
|||||||
|
|
||||||
iworlddataserver.setWorldBorder(worldserver1.getWorldBorder().createSettings());
|
iworlddataserver.setWorldBorder(worldserver1.getWorldBorder().createSettings());
|
||||||
this.worldData.setCustomBossEvents(this.getCustomBossEvents().save());
|
this.worldData.setCustomBossEvents(this.getCustomBossEvents().save());
|
||||||
this.storageSource.saveDataTag(this.registryHolder, this.worldData, this.getPlayerList().getSingleplayerData());
|
this.storageSource.saveDataTag(this.registryAccess(), this.worldData, this.getPlayerList().getSingleplayerData());
|
||||||
+ */
|
+ */
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
Iterator iterator1 = this.getAllLevels().iterator();
|
Iterator iterator1 = this.getAllLevels().iterator();
|
||||||
|
|
||||||
@@ -627,8 +870,29 @@
|
@@ -630,8 +872,29 @@
|
||||||
this.stopServer();
|
this.stopServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +544,7 @@
|
|||||||
if (this.getConnection() != null) {
|
if (this.getConnection() != null) {
|
||||||
this.getConnection().stop();
|
this.getConnection().stop();
|
||||||
}
|
}
|
||||||
@@ -638,6 +902,7 @@
|
@@ -641,6 +904,7 @@
|
||||||
MinecraftServer.LOGGER.info("Saving players");
|
MinecraftServer.LOGGER.info("Saving players");
|
||||||
this.playerList.saveAll();
|
this.playerList.saveAll();
|
||||||
this.playerList.removeAll();
|
this.playerList.removeAll();
|
||||||
@ -553,7 +552,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Saving worlds");
|
MinecraftServer.LOGGER.info("Saving worlds");
|
||||||
@@ -712,9 +977,10 @@
|
@@ -732,9 +996,10 @@
|
||||||
while (this.running) {
|
while (this.running) {
|
||||||
long i = SystemUtils.getMillis() - this.nextTickTime;
|
long i = SystemUtils.getMillis() - this.nextTickTime;
|
||||||
|
|
||||||
@ -565,15 +564,15 @@
|
|||||||
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
|
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
|
||||||
this.nextTickTime += j * 50L;
|
this.nextTickTime += j * 50L;
|
||||||
this.lastOverloadWarning = this.nextTickTime;
|
this.lastOverloadWarning = this.nextTickTime;
|
||||||
@@ -725,6 +991,7 @@
|
@@ -745,6 +1010,7 @@
|
||||||
this.debugCommandProfiler = new MinecraftServer.a(SystemUtils.getNanos(), this.tickCount);
|
this.debugCommandProfiler = new MinecraftServer.b(SystemUtils.getNanos(), this.tickCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
||||||
this.nextTickTime += 50L;
|
this.nextTickTime += 50L;
|
||||||
this.startMetricsRecordingTick();
|
this.startMetricsRecordingTick();
|
||||||
this.profiler.push("tick");
|
this.profiler.push("tick");
|
||||||
@@ -775,6 +1042,12 @@
|
@@ -789,6 +1055,12 @@
|
||||||
this.profileCache.clearExecutor();
|
this.profileCache.clearExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +585,7 @@
|
|||||||
this.onServerExit();
|
this.onServerExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -783,8 +1056,15 @@
|
@@ -822,8 +1094,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean haveTime() {
|
private boolean haveTime() {
|
||||||
@ -603,7 +602,7 @@
|
|||||||
|
|
||||||
protected void waitUntilNextTick() {
|
protected void waitUntilNextTick() {
|
||||||
this.runAllTasks();
|
this.runAllTasks();
|
||||||
@@ -830,7 +1110,7 @@
|
@@ -869,7 +1148,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +611,7 @@
|
|||||||
this.getProfiler().incrementCounter("runTask");
|
this.getProfiler().incrementCounter("runTask");
|
||||||
super.doRunTask(ticktask);
|
super.doRunTask(ticktask);
|
||||||
}
|
}
|
||||||
@@ -901,7 +1181,7 @@
|
@@ -940,7 +1219,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +620,7 @@
|
|||||||
MinecraftServer.LOGGER.debug("Autosave started");
|
MinecraftServer.LOGGER.debug("Autosave started");
|
||||||
this.profiler.push("save");
|
this.profiler.push("save");
|
||||||
this.saveEverything(true, false, false);
|
this.saveEverything(true, false, false);
|
||||||
@@ -920,22 +1200,39 @@
|
@@ -959,22 +1238,39 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tickChildren(BooleanSupplier booleansupplier) {
|
public void tickChildren(BooleanSupplier booleansupplier) {
|
||||||
@ -661,7 +660,7 @@
|
|||||||
|
|
||||||
this.profiler.push("tick");
|
this.profiler.push("tick");
|
||||||
|
|
||||||
@@ -1024,7 +1321,7 @@
|
@@ -1063,7 +1359,7 @@
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@ -670,9 +669,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport systemreport) {
|
public SystemReport fillSystemReport(SystemReport systemreport) {
|
||||||
@@ -1354,16 +1651,17 @@
|
@@ -1406,11 +1702,11 @@
|
||||||
|
|
||||||
public CompletableFuture<Void> reloadResources(Collection<String> collection) {
|
public CompletableFuture<Void> reloadResources(Collection<String> collection) {
|
||||||
|
IRegistryCustom.Dimension iregistrycustom_dimension = this.registryAccess();
|
||||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||||
- Stream stream = collection.stream();
|
- Stream stream = collection.stream();
|
||||||
+ Stream<String> stream = collection.stream(); // CraftBukkit - decompile error
|
+ Stream<String> stream = collection.stream(); // CraftBukkit - decompile error
|
||||||
@ -682,15 +681,17 @@
|
|||||||
- return (ImmutableList) stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(ResourcePackLoader::open).collect(ImmutableList.toImmutableList());
|
- return (ImmutableList) stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(ResourcePackLoader::open).collect(ImmutableList.toImmutableList());
|
||||||
+ return stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(ResourcePackLoader::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error
|
+ return stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(ResourcePackLoader::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error
|
||||||
}, this).thenCompose((immutablelist) -> {
|
}, this).thenCompose((immutablelist) -> {
|
||||||
return DataPackResources.loadResources(immutablelist, this.registryHolder, this.isDedicatedServer() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this);
|
ResourceManager resourcemanager = new ResourceManager(EnumResourcePackType.SERVER_DATA, immutablelist);
|
||||||
}).thenAcceptAsync((datapackresources) -> {
|
|
||||||
|
@@ -1425,6 +1721,7 @@
|
||||||
|
}).thenAcceptAsync((minecraftserver_a) -> {
|
||||||
this.resources.close();
|
this.resources.close();
|
||||||
this.resources = datapackresources;
|
this.resources = minecraftserver_a;
|
||||||
+ this.server.syncCommands(); // SPIGOT-5884: Lost on reload
|
+ this.server.syncCommands(); // SPIGOT-5884: Lost on reload
|
||||||
this.packRepository.setSelected(collection);
|
this.packRepository.setSelected(collection);
|
||||||
this.worldData.setDataPackConfig(getSelectedPacks(this.packRepository));
|
this.worldData.setDataPackConfig(getSelectedPacks(this.packRepository));
|
||||||
datapackresources.updateGlobals();
|
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||||
@@ -1717,7 +2015,7 @@
|
@@ -1774,7 +2071,7 @@
|
||||||
try {
|
try {
|
||||||
label51:
|
label51:
|
||||||
{
|
{
|
||||||
@ -699,7 +700,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
arraylist = Lists.newArrayList(NativeModuleLister.listModules());
|
arraylist = Lists.newArrayList(NativeModuleLister.listModules());
|
||||||
@@ -1767,6 +2065,22 @@
|
@@ -1824,6 +2121,22 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,3 +723,24 @@
|
|||||||
private void startMetricsRecordingTick() {
|
private void startMetricsRecordingTick() {
|
||||||
if (this.willStartRecordingMetrics) {
|
if (this.willStartRecordingMetrics) {
|
||||||
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.isDedicatedServer()), SystemUtils.timeSource, SystemUtils.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.isDedicatedServer()), SystemUtils.timeSource, SystemUtils.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||||
|
@@ -1935,8 +2248,10 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- private static record a(IReloadableResourceManager a, DataPackResources b) implements AutoCloseable {
|
||||||
|
+ // CraftBukkit start - decompile error
|
||||||
|
+ public static record a(IReloadableResourceManager resourceManager, DataPackResources managers) implements AutoCloseable {
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
final IReloadableResourceManager resourceManager;
|
||||||
|
final DataPackResources managers;
|
||||||
|
|
||||||
|
@@ -1944,6 +2259,8 @@
|
||||||
|
this.resourceManager = ireloadableresourcemanager;
|
||||||
|
this.managers = datapackresources;
|
||||||
|
}
|
||||||
|
+ */
|
||||||
|
+ // CraftBukkit end
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
this.resourceManager.close();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/commands/CommandSpreadPlayers.java
|
--- a/net/minecraft/server/commands/CommandSpreadPlayers.java
|
||||||
+++ b/net/minecraft/server/commands/CommandSpreadPlayers.java
|
+++ b/net/minecraft/server/commands/CommandSpreadPlayers.java
|
||||||
@@ -79,7 +79,7 @@
|
@@ -90,7 +90,7 @@
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
set.add(entity.getTeam());
|
set.add(entity.getTeam());
|
||||||
} else {
|
} else {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@
|
@@ -299,7 +299,7 @@
|
||||||
|
|
||||||
for (boolean flag2 = iblockaccess.getBlockState(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > iblockaccess.getMinBuildHeight(); flag2 = flag1) {
|
for (boolean flag2 = iblockaccess.getBlockState(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > iblockaccess.getMinBuildHeight(); flag2 = flag1) {
|
||||||
blockposition_mutableblockposition.move(EnumDirection.DOWN);
|
blockposition_mutableblockposition.move(EnumDirection.DOWN);
|
||||||
@ -18,7 +18,7 @@
|
|||||||
if (!flag1 && flag2 && flag) {
|
if (!flag1 && flag2 && flag) {
|
||||||
return blockposition_mutableblockposition.getY() + 1;
|
return blockposition_mutableblockposition.getY() + 1;
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@
|
@@ -312,7 +312,7 @@
|
||||||
|
|
||||||
public boolean isSafe(IBlockAccess iblockaccess, int i) {
|
public boolean isSafe(IBlockAccess iblockaccess, int i) {
|
||||||
BlockPosition blockposition = new BlockPosition(this.x, (double) (this.getSpawnY(iblockaccess, i) - 1), this.z);
|
BlockPosition blockposition = new BlockPosition(this.x, (double) (this.getSpawnY(iblockaccess, i) - 1), this.z);
|
||||||
@ -27,7 +27,7 @@
|
|||||||
Material material = iblockdata.getMaterial();
|
Material material = iblockdata.getMaterial();
|
||||||
|
|
||||||
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
|
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
|
||||||
@@ -311,5 +311,12 @@
|
@@ -322,5 +322,12 @@
|
||||||
this.x = MathHelper.nextDouble(random, d0, d2);
|
this.x = MathHelper.nextDouble(random, d0, d2);
|
||||||
this.z = MathHelper.nextDouble(random, d1, d3);
|
this.z = MathHelper.nextDouble(random, d1, d3);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -61,6 +61,15 @@
|
@@ -59,6 +59,18 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.storage.Convertable;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
|
+import com.mojang.serialization.DynamicOps;
|
||||||
|
+import net.minecraft.nbt.NBTBase;
|
||||||
+import net.minecraft.world.level.DataPackConfiguration;
|
+import net.minecraft.world.level.DataPackConfiguration;
|
||||||
+import org.apache.logging.log4j.Level;
|
+import org.apache.logging.log4j.Level;
|
||||||
|
+import org.apache.logging.log4j.LogManager;
|
||||||
+import org.apache.logging.log4j.io.IoBuilder;
|
+import org.apache.logging.log4j.io.IoBuilder;
|
||||||
+import org.bukkit.command.CommandSender;
|
+import org.bukkit.command.CommandSender;
|
||||||
+import org.bukkit.event.server.ServerCommandEvent;
|
+import org.bukkit.event.server.ServerCommandEvent;
|
||||||
@ -15,21 +18,21 @@
|
|||||||
+
|
+
|
||||||
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
|
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -81,8 +90,10 @@
|
@@ -79,8 +91,10 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
private final IChatBaseComponent resourcePackPrompt;
|
private final IChatBaseComponent resourcePackPrompt;
|
||||||
|
|
||||||
- public DedicatedServer(Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, DataPackResources datapackresources, SaveData savedata, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
- public DedicatedServer(Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
||||||
- super(thread, iregistrycustom_dimension, convertable_conversionsession, savedata, resourcepackrepository, Proxy.NO_PROXY, datafixer, datapackresources, minecraftsessionservice, gameprofilerepository, usercache, worldloadlistenerfactory);
|
- super(thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, minecraftsessionservice, gameprofilerepository, usercache, worldloadlistenerfactory);
|
||||||
+ // CraftBukkit start - Signature changed
|
+ // CraftBukkit start - Signature changed
|
||||||
+ public DedicatedServer(joptsimple.OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, DataPackResources datapackresources, SaveData savedata, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
+ public DedicatedServer(joptsimple.OptionSet options, DataPackConfiguration datapackconfiguration, DynamicOps<NBTBase> registryreadops, Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) {
|
||||||
+ super(options, datapackconfiguration, thread, iregistrycustom_dimension, convertable_conversionsession, savedata, resourcepackrepository, Proxy.NO_PROXY, datafixer, datapackresources, minecraftsessionservice, gameprofilerepository, usercache, worldloadlistenerfactory);
|
+ super(options, datapackconfiguration, registryreadops, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, minecraftsessionservice, gameprofilerepository, usercache, worldloadlistenerfactory);
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.settings = dedicatedserversettings;
|
this.settings = dedicatedserversettings;
|
||||||
this.rconConsoleSource = new RemoteControlCommandListener(this);
|
this.rconConsoleSource = new RemoteControlCommandListener(this);
|
||||||
this.textFilterClient = TextFilter.createFromConfig(dedicatedserversettings.getProperties().textFilteringConfig);
|
this.textFilterClient = TextFilter.createFromConfig(dedicatedserversettings.getProperties().textFilteringConfig);
|
||||||
@@ -93,13 +104,44 @@
|
@@ -91,13 +105,44 @@
|
||||||
public boolean initServer() throws IOException {
|
public boolean initServer() throws IOException {
|
||||||
Thread thread = new Thread("Server console handler") {
|
Thread thread = new Thread("Server console handler") {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -77,7 +80,7 @@
|
|||||||
}
|
}
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
|
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
|
||||||
@@ -108,6 +150,27 @@
|
@@ -106,6 +151,27 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -105,7 +108,7 @@
|
|||||||
thread.setDaemon(true);
|
thread.setDaemon(true);
|
||||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
|
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
|
||||||
thread.start();
|
thread.start();
|
||||||
@@ -133,7 +196,7 @@
|
@@ -131,7 +197,7 @@
|
||||||
this.setMotd(dedicatedserverproperties.motd);
|
this.setMotd(dedicatedserverproperties.motd);
|
||||||
super.setPlayerIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
|
super.setPlayerIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
|
||||||
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
|
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
|
||||||
@ -114,7 +117,7 @@
|
|||||||
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
|
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
|
||||||
InetAddress inetaddress = null;
|
InetAddress inetaddress = null;
|
||||||
|
|
||||||
@@ -157,6 +220,12 @@
|
@@ -155,6 +221,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,12 +130,12 @@
|
|||||||
if (!this.usesAuthentication()) {
|
if (!this.usesAuthentication()) {
|
||||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||||
@@ -171,13 +240,13 @@
|
@@ -169,13 +241,13 @@
|
||||||
if (!NameReferencingFileConverter.serverReadyAfterUserconversion(this)) {
|
if (!NameReferencingFileConverter.serverReadyAfterUserconversion(this)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
- this.setPlayerList(new DedicatedPlayerList(this, this.registryHolder, this.playerDataStorage));
|
- this.setPlayerList(new DedicatedPlayerList(this, this.registryAccess(), this.playerDataStorage));
|
||||||
+ // this.setPlayerList(new DedicatedPlayerList(this, this.registryHolder, this.playerDataStorage)); // CraftBukkit - moved up
|
+ // this.setPlayerList(new DedicatedPlayerList(this, this.registryAccess(), this.playerDataStorage)); // CraftBukkit - moved up
|
||||||
long i = SystemUtils.getNanos();
|
long i = SystemUtils.getNanos();
|
||||||
|
|
||||||
TileEntitySkull.setup(this.getProfileCache(), this.getSessionService(), this);
|
TileEntitySkull.setup(this.getProfileCache(), this.getSessionService(), this);
|
||||||
@ -143,7 +146,7 @@
|
|||||||
long j = SystemUtils.getNanos() - i;
|
long j = SystemUtils.getNanos() - i;
|
||||||
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
|
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
|
||||||
|
|
||||||
@@ -194,6 +263,7 @@
|
@@ -192,6 +264,7 @@
|
||||||
if (dedicatedserverproperties.enableRcon) {
|
if (dedicatedserverproperties.enableRcon) {
|
||||||
DedicatedServer.LOGGER.info("Starting remote control listener");
|
DedicatedServer.LOGGER.info("Starting remote control listener");
|
||||||
this.rconThread = RemoteControlListener.create(this);
|
this.rconThread = RemoteControlListener.create(this);
|
||||||
@ -151,7 +154,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.getMaxTickLength() > 0L) {
|
if (this.getMaxTickLength() > 0L) {
|
||||||
@@ -337,6 +407,7 @@
|
@@ -335,6 +408,7 @@
|
||||||
this.queryThreadGs4.stop();
|
this.queryThreadGs4.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +162,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -358,7 +429,15 @@
|
@@ -356,7 +430,15 @@
|
||||||
while (!this.consoleInput.isEmpty()) {
|
while (!this.consoleInput.isEmpty()) {
|
||||||
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
|
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
|
||||||
|
|
||||||
@ -176,7 +179,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -568,14 +647,45 @@
|
@@ -566,14 +648,45 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPluginNames() {
|
public String getPluginNames() {
|
||||||
@ -224,7 +227,7 @@
|
|||||||
});
|
});
|
||||||
return this.rconConsoleSource.getCommandResponse();
|
return this.rconConsoleSource.getCommandResponse();
|
||||||
}
|
}
|
||||||
@@ -649,4 +759,15 @@
|
@@ -647,4 +760,15 @@
|
||||||
public IChatBaseComponent getResourcePackPrompt() {
|
public IChatBaseComponent getResourcePackPrompt() {
|
||||||
return this.resourcePackPrompt;
|
return this.resourcePackPrompt;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
@@ -10,8 +10,14 @@
|
@@ -13,8 +13,14 @@
|
||||||
import net.minecraft.world.level.EnumGamemode;
|
import net.minecraft.world.level.EnumGamemode;
|
||||||
import net.minecraft.world.level.levelgen.GeneratorSettings;
|
import net.minecraft.world.level.levelgen.GeneratorSettings;
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
public final boolean onlineMode = this.get("online-mode", true);
|
public final boolean onlineMode = this.get("online-mode", true);
|
||||||
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
||||||
public final String serverIp = this.get("server-ip", "");
|
public final String serverIp = this.get("server-ip", "");
|
||||||
@@ -67,8 +73,10 @@
|
@@ -71,8 +77,10 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
private GeneratorSettings worldGenSettings;
|
private GeneratorSettings worldGenSettings;
|
||||||
|
|
||||||
@ -28,8 +28,8 @@
|
|||||||
this.difficulty = (EnumDifficulty) this.get("difficulty", dispatchNumberOrString(EnumDifficulty::byId, EnumDifficulty::byName), EnumDifficulty::getKey, EnumDifficulty.EASY);
|
this.difficulty = (EnumDifficulty) this.get("difficulty", dispatchNumberOrString(EnumDifficulty::byId, EnumDifficulty::byName), EnumDifficulty::getKey, EnumDifficulty.EASY);
|
||||||
this.gamemode = (EnumGamemode) this.get("gamemode", dispatchNumberOrString(EnumGamemode::byId, EnumGamemode::byName), EnumGamemode::getName, EnumGamemode.SURVIVAL);
|
this.gamemode = (EnumGamemode) this.get("gamemode", dispatchNumberOrString(EnumGamemode::byId, EnumGamemode::byName), EnumGamemode::getName, EnumGamemode.SURVIVAL);
|
||||||
this.levelName = this.get("level-name", "world");
|
this.levelName = this.get("level-name", "world");
|
||||||
@@ -112,13 +120,15 @@
|
@@ -121,13 +129,15 @@
|
||||||
this.whiteList = this.getMutable("white-list", false);
|
}, "default"));
|
||||||
}
|
}
|
||||||
|
|
||||||
- public static DedicatedServerProperties fromFile(Path path) {
|
- public static DedicatedServerProperties fromFile(Path path) {
|
||||||
@ -48,3 +48,24 @@
|
|||||||
|
|
||||||
dedicatedserverproperties.getWorldGenSettings(iregistrycustom);
|
dedicatedserverproperties.getWorldGenSettings(iregistrycustom);
|
||||||
return dedicatedserverproperties;
|
return dedicatedserverproperties;
|
||||||
|
@@ -141,8 +151,10 @@
|
||||||
|
return this.worldGenSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
- public static record a(String a, JsonObject b, boolean c, String d) {
|
||||||
|
+ // CraftBukkit start - decompile error
|
||||||
|
+ public static record a(String levelSeed, JsonObject generatorSettings, boolean generateStructures, String levelType) {
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
private final String levelSeed;
|
||||||
|
private final JsonObject generatorSettings;
|
||||||
|
private final boolean generateStructures;
|
||||||
|
@@ -154,6 +166,8 @@
|
||||||
|
this.generateStructures = flag;
|
||||||
|
this.levelType = s1;
|
||||||
|
}
|
||||||
|
+ */
|
||||||
|
+ // CraftBukkit end
|
||||||
|
|
||||||
|
public String levelSeed() {
|
||||||
|
return this.levelSeed;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
--- a/net/minecraft/server/dedicated/PropertyManager.java
|
--- a/net/minecraft/server/dedicated/PropertyManager.java
|
||||||
+++ b/net/minecraft/server/dedicated/PropertyManager.java
|
+++ b/net/minecraft/server/dedicated/PropertyManager.java
|
||||||
@@ -17,15 +17,30 @@
|
@@ -17,15 +17,30 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.core.IRegistryCustom;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+import joptsimple.OptionSet; // CraftBukkit
|
+import joptsimple.OptionSet; // CraftBukkit
|
||||||
+
|
+
|
||||||
public abstract class PropertyManager<T extends PropertyManager<T>> {
|
public abstract class PropertyManager<T extends PropertyManager<T>> {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
public final Properties properties;
|
public final Properties properties;
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ private OptionSet options = null;
|
+ private OptionSet options = null;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/level/ChunkMapDistance.java
|
--- a/net/minecraft/server/level/ChunkMapDistance.java
|
||||||
+++ b/net/minecraft/server/level/ChunkMapDistance.java
|
+++ b/net/minecraft/server/level/ChunkMapDistance.java
|
||||||
@@ -125,10 +125,25 @@
|
@@ -126,10 +126,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.chunksToUpdateFutures.isEmpty()) {
|
if (!this.chunksToUpdateFutures.isEmpty()) {
|
||||||
@ -29,7 +29,7 @@
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (!this.ticketsToRelease.isEmpty()) {
|
if (!this.ticketsToRelease.isEmpty()) {
|
||||||
@@ -164,7 +179,7 @@
|
@@ -165,7 +180,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@
|
|||||||
ArraySetSorted<Ticket<?>> arraysetsorted = this.getTickets(i);
|
ArraySetSorted<Ticket<?>> arraysetsorted = this.getTickets(i);
|
||||||
int j = getTicketLevelAt(arraysetsorted);
|
int j = getTicketLevelAt(arraysetsorted);
|
||||||
Ticket<?> ticket1 = (Ticket) arraysetsorted.addOrGet(ticket);
|
Ticket<?> ticket1 = (Ticket) arraysetsorted.addOrGet(ticket);
|
||||||
@@ -174,13 +189,15 @@
|
@@ -175,13 +190,15 @@
|
||||||
this.ticketTracker.update(i, ticket.getTicketLevel(), true);
|
this.ticketTracker.update(i, ticket.getTicketLevel(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (arraysetsorted.isEmpty()) {
|
if (arraysetsorted.isEmpty()) {
|
||||||
@@ -188,6 +205,7 @@
|
@@ -189,6 +206,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ticketTracker.update(i, getTicketLevelAt(arraysetsorted), false);
|
this.ticketTracker.update(i, getTicketLevelAt(arraysetsorted), false);
|
||||||
@ -64,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <T> void addTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
|
public <T> void addTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
|
||||||
@@ -201,19 +219,33 @@
|
@@ -202,19 +220,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void addRegionTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
|
public <T> void addRegionTicket(TicketType<T> tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
|
||||||
@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ArraySetSorted<Ticket<?>> getTickets(long i) {
|
private ArraySetSorted<Ticket<?>> getTickets(long i) {
|
||||||
@@ -252,6 +284,7 @@
|
@@ -253,6 +285,7 @@
|
||||||
ChunkCoordIntPair chunkcoordintpair = sectionposition.chunk();
|
ChunkCoordIntPair chunkcoordintpair = sectionposition.chunk();
|
||||||
long i = chunkcoordintpair.toLong();
|
long i = chunkcoordintpair.toLong();
|
||||||
ObjectSet<EntityPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
ObjectSet<EntityPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
||||||
@ -108,8 +108,8 @@
|
|||||||
|
|
||||||
objectset.remove(entityplayer);
|
objectset.remove(entityplayer);
|
||||||
if (objectset.isEmpty()) {
|
if (objectset.isEmpty()) {
|
||||||
@@ -347,6 +380,26 @@
|
@@ -382,6 +415,26 @@
|
||||||
return this.tickingTicketsTracker;
|
return !this.tickets.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/level/ChunkProviderServer.java
|
--- a/net/minecraft/server/level/ChunkProviderServer.java
|
||||||
+++ b/net/minecraft/server/level/ChunkProviderServer.java
|
+++ b/net/minecraft/server/level/ChunkProviderServer.java
|
||||||
@@ -86,6 +86,24 @@
|
@@ -83,6 +83,24 @@
|
||||||
this.clearCache();
|
this.clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,14 +18,14 @@
|
|||||||
+ if (chunk == null) {
|
+ if (chunk == null) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ return chunk.getFullChunkUnchecked();
|
+ return chunk.getFullChunk();
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public LightEngineThreaded getLightEngine() {
|
public LightEngineThreaded getLightEngine() {
|
||||||
return this.lightEngine;
|
return this.lightEngine;
|
||||||
@@ -130,7 +148,7 @@
|
@@ -127,7 +145,7 @@
|
||||||
for (int l = 0; l < 4; ++l) {
|
for (int l = 0; l < 4; ++l) {
|
||||||
if (k == this.lastChunkPos[l] && chunkstatus == this.lastChunkStatus[l]) {
|
if (k == this.lastChunkPos[l] && chunkstatus == this.lastChunkStatus[l]) {
|
||||||
ichunkaccess = this.lastChunk[l];
|
ichunkaccess = this.lastChunk[l];
|
||||||
@ -34,7 +34,7 @@
|
|||||||
return ichunkaccess;
|
return ichunkaccess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,12 +196,12 @@
|
@@ -175,12 +193,12 @@
|
||||||
if (playerchunk == null) {
|
if (playerchunk == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
if (ichunkaccess1 != null) {
|
if (ichunkaccess1 != null) {
|
||||||
this.storeInCache(k, ichunkaccess1, ChunkStatus.FULL);
|
this.storeInCache(k, ichunkaccess1, ChunkStatus.FULL);
|
||||||
@@ -231,7 +249,15 @@
|
@@ -228,7 +246,15 @@
|
||||||
int l = 33 + ChunkStatus.getDistance(chunkstatus);
|
int l = 33 + ChunkStatus.getDistance(chunkstatus);
|
||||||
PlayerChunk playerchunk = this.getVisibleChunkIfPresent(k);
|
PlayerChunk playerchunk = this.getVisibleChunkIfPresent(k);
|
||||||
|
|
||||||
@ -66,7 +66,7 @@
|
|||||||
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
||||||
if (this.chunkAbsent(playerchunk, l)) {
|
if (this.chunkAbsent(playerchunk, l)) {
|
||||||
GameProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
GameProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
@@ -250,7 +276,7 @@
|
@@ -247,7 +273,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean chunkAbsent(@Nullable PlayerChunk playerchunk, int i) {
|
private boolean chunkAbsent(@Nullable PlayerChunk playerchunk, int i) {
|
||||||
@ -75,7 +75,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -317,7 +343,7 @@
|
@@ -314,7 +340,7 @@
|
||||||
} else if (!this.level.shouldTickBlocksAt(i)) {
|
} else if (!this.level.shouldTickBlocksAt(i)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
return either != null && either.left().isPresent();
|
return either != null && either.left().isPresent();
|
||||||
}
|
}
|
||||||
@@ -330,11 +356,31 @@
|
@@ -327,11 +353,31 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
@ -115,7 +115,7 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void tick(BooleanSupplier booleansupplier) {
|
public void tick(BooleanSupplier booleansupplier, boolean flag) {
|
||||||
this.level.getProfiler().push("purge");
|
this.level.getProfiler().push("purge");
|
||||||
@@ -363,7 +409,7 @@
|
@@ -363,7 +409,7 @@
|
||||||
|
|
||||||
@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
Collections.shuffle(list);
|
Collections.shuffle(list);
|
||||||
Iterator iterator1 = list.iterator();
|
Iterator iterator1 = list.iterator();
|
||||||
@@ -579,18 +625,26 @@
|
@@ -581,18 +627,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -164,7 +164,7 @@
|
|||||||
final Chunk chunk;
|
final Chunk chunk;
|
||||||
final PlayerChunk holder;
|
final PlayerChunk holder;
|
||||||
|
|
||||||
@@ -606,5 +660,7 @@
|
@@ -608,5 +662,7 @@
|
||||||
public PlayerChunk holder() {
|
public PlayerChunk holder() {
|
||||||
return this.holder;
|
return this.holder;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/level/EntityPlayer.java
|
--- a/net/minecraft/server/level/EntityPlayer.java
|
||||||
+++ b/net/minecraft/server/level/EntityPlayer.java
|
+++ b/net/minecraft/server/level/EntityPlayer.java
|
||||||
@@ -140,6 +140,33 @@
|
@@ -140,6 +140,33 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.scores.criteria.IScoreboardCriteria;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.nbt.NBTBase;
|
+import net.minecraft.nbt.NBTBase;
|
||||||
@ -33,7 +33,7 @@
|
|||||||
+
|
+
|
||||||
public class EntityPlayer extends EntityHuman {
|
public class EntityPlayer extends EntityHuman {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -194,6 +221,20 @@
|
@@ -194,6 +221,20 @@
|
||||||
public int latency;
|
public int latency;
|
||||||
public boolean wonGame;
|
public boolean wonGame;
|
||||||
@ -113,7 +113,7 @@
|
|||||||
int i = Math.max(0, this.server.getSpawnRadius(worldserver));
|
int i = Math.max(0, this.server.getSpawnRadius(worldserver));
|
||||||
int j = MathHelper.floor(worldserver.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
|
int j = MathHelper.floor(worldserver.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
|
||||||
|
|
||||||
@@ -319,11 +404,20 @@
|
@@ -319,17 +404,26 @@
|
||||||
if (nbttagcompound.contains("recipeBook", 10)) {
|
if (nbttagcompound.contains("recipeBook", 10)) {
|
||||||
this.recipeBook.fromNbt(nbttagcompound.getCompound("recipeBook"), this.server.getRecipeManager());
|
this.recipeBook.fromNbt(nbttagcompound.getCompound("recipeBook"), this.server.getRecipeManager());
|
||||||
}
|
}
|
||||||
@ -134,6 +134,13 @@
|
|||||||
if (nbttagcompound.contains("SpawnX", 99) && nbttagcompound.contains("SpawnY", 99) && nbttagcompound.contains("SpawnZ", 99)) {
|
if (nbttagcompound.contains("SpawnX", 99) && nbttagcompound.contains("SpawnY", 99) && nbttagcompound.contains("SpawnZ", 99)) {
|
||||||
this.respawnPosition = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
this.respawnPosition = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
||||||
this.respawnForced = nbttagcompound.getBoolean("SpawnForced");
|
this.respawnForced = nbttagcompound.getBoolean("SpawnForced");
|
||||||
|
this.respawnAngle = nbttagcompound.getFloat("SpawnAngle");
|
||||||
|
if (nbttagcompound.contains("SpawnDimension")) {
|
||||||
|
- DataResult dataresult = World.RESOURCE_KEY_CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("SpawnDimension"));
|
||||||
|
+ DataResult<ResourceKey<World>> dataresult = World.RESOURCE_KEY_CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("SpawnDimension")); // CraftBukkit - decompile error
|
||||||
|
Logger logger = EntityPlayer.LOGGER;
|
||||||
|
|
||||||
|
Objects.requireNonNull(logger);
|
||||||
@@ -356,7 +450,20 @@
|
@@ -356,7 +450,20 @@
|
||||||
Entity entity = this.getRootVehicle();
|
Entity entity = this.getRootVehicle();
|
||||||
Entity entity1 = this.getVehicle();
|
Entity entity1 = this.getVehicle();
|
||||||
@ -414,7 +421,7 @@
|
|||||||
+ /*
|
+ /*
|
||||||
WorldData worlddata = worldserver.getLevelData();
|
WorldData worlddata = worldserver.getLevelData();
|
||||||
|
|
||||||
this.connection.send(new PacketPlayOutRespawn(worldserver.dimensionType(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
|
this.connection.send(new PacketPlayOutRespawn(worldserver.dimensionTypeRegistration(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
|
||||||
@@ -780,22 +993,52 @@
|
@@ -780,22 +993,52 @@
|
||||||
playerlist.sendPlayerPermissionLevel(this);
|
playerlist.sendPlayerPermissionLevel(this);
|
||||||
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||||
@ -454,7 +461,7 @@
|
|||||||
+ if (true) { // CraftBukkit
|
+ if (true) { // CraftBukkit
|
||||||
+ this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
+ this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
||||||
+
|
+
|
||||||
+ this.connection.send(new PacketPlayOutRespawn(worldserver.dimensionType(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
|
+ this.connection.send(new PacketPlayOutRespawn(worldserver.dimensionTypeRegistration(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
|
||||||
+ this.connection.send(new PacketPlayOutServerDifficulty(this.level.getDifficulty(), this.level.getLevelData().isDifficultyLocked()));
|
+ this.connection.send(new PacketPlayOutServerDifficulty(this.level.getDifficulty(), this.level.getLevelData().isDifficultyLocked()));
|
||||||
+ PlayerList playerlist = this.server.getPlayerList();
|
+ PlayerList playerlist = this.server.getPlayerList();
|
||||||
+
|
+
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/level/EntityTrackerEntry.java
|
--- a/net/minecraft/server/level/EntityTrackerEntry.java
|
||||||
+++ b/net/minecraft/server/level/EntityTrackerEntry.java
|
+++ b/net/minecraft/server/level/EntityTrackerEntry.java
|
||||||
@@ -40,6 +40,12 @@
|
@@ -40,6 +40,12 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.server.network.ServerPlayerConnection;
|
+import net.minecraft.server.network.ServerPlayerConnection;
|
||||||
@ -12,7 +12,7 @@
|
|||||||
+
|
+
|
||||||
public class EntityTrackerEntry {
|
public class EntityTrackerEntry {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -61,8 +67,12 @@
|
@@ -61,8 +67,12 @@
|
||||||
private List<Entity> lastPassengers;
|
private List<Entity> lastPassengers;
|
||||||
private boolean wasRiding;
|
private boolean wasRiding;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/level/PlayerChunk.java
|
--- a/net/minecraft/server/level/PlayerChunk.java
|
||||||
+++ b/net/minecraft/server/level/PlayerChunk.java
|
+++ b/net/minecraft/server/level/PlayerChunk.java
|
||||||
@@ -35,6 +35,10 @@
|
@@ -37,6 +37,10 @@
|
||||||
import net.minecraft.world.level.chunk.ProtoChunkExtension;
|
import net.minecraft.world.level.chunk.ProtoChunkExtension;
|
||||||
import net.minecraft.world.level.lighting.LightEngine;
|
import net.minecraft.world.level.lighting.LightEngine;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
public class PlayerChunk {
|
public class PlayerChunk {
|
||||||
|
|
||||||
public static final Either<IChunkAccess, PlayerChunk.Failure> UNLOADED_CHUNK = Either.right(PlayerChunk.Failure.UNLOADED);
|
public static final Either<IChunkAccess, PlayerChunk.Failure> UNLOADED_CHUNK = Either.right(PlayerChunk.Failure.UNLOADED);
|
||||||
@@ -72,11 +76,11 @@
|
@@ -75,11 +79,11 @@
|
||||||
this.fullChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
this.fullChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||||
this.tickingChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
this.tickingChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||||
this.entityTickingChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
this.entityTickingChunkFuture = PlayerChunk.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||||
@ -25,27 +25,7 @@
|
|||||||
this.pos = chunkcoordintpair;
|
this.pos = chunkcoordintpair;
|
||||||
this.levelHeightAccessor = levelheightaccessor;
|
this.levelHeightAccessor = levelheightaccessor;
|
||||||
this.lightEngine = lightengine;
|
this.lightEngine = lightengine;
|
||||||
@@ -89,6 +93,19 @@
|
@@ -117,17 +121,17 @@
|
||||||
this.changedBlocksPerSection = new ShortSet[levelheightaccessor.getSectionsCount()];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ public Chunk getFullChunk() {
|
|
||||||
+ if (!getFullChunkStatus(this.oldTicketLevel).isOrAfter(PlayerChunk.State.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks
|
|
||||||
+ return this.getFullChunkUnchecked();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Chunk getFullChunkUnchecked() {
|
|
||||||
+ CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> statusFuture = this.getFutureIfPresentUnchecked(ChunkStatus.FULL);
|
|
||||||
+ Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null);
|
|
||||||
+ return (either == null) ? null : (Chunk) either.left().orElse(null);
|
|
||||||
+ }
|
|
||||||
+ // CraftBukkit end
|
|
||||||
+
|
|
||||||
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getFutureIfPresentUnchecked(ChunkStatus chunkstatus) {
|
|
||||||
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.futures.get(chunkstatus.getIndex());
|
|
||||||
|
|
||||||
@@ -114,9 +131,9 @@
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Chunk getTickingChunk() {
|
public Chunk getTickingChunk() {
|
||||||
CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.getTickingChunkFuture();
|
CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.getTickingChunkFuture();
|
||||||
@ -57,7 +37,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -161,6 +178,7 @@
|
public Chunk getFullChunk() {
|
||||||
|
CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.getFullChunkFuture();
|
||||||
|
- Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow((Object) null);
|
||||||
|
+ Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
||||||
|
|
||||||
|
- return either == null ? null : (Chunk) either.left().orElse((Object) null);
|
||||||
|
+ return either == null ? null : (Chunk) either.left().orElse(null); // CraftBukkit - decompile error
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@@ -172,6 +176,7 @@
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
int i = this.levelHeightAccessor.getSectionIndex(blockposition.getY());
|
int i = this.levelHeightAccessor.getSectionIndex(blockposition.getY());
|
||||||
|
|
||||||
@ -65,16 +55,7 @@
|
|||||||
if (this.changedBlocksPerSection[i] == null) {
|
if (this.changedBlocksPerSection[i] == null) {
|
||||||
this.hasChangedSections = true;
|
this.hasChangedSections = true;
|
||||||
this.changedBlocksPerSection[i] = new ShortOpenHashSet();
|
this.changedBlocksPerSection[i] = new ShortOpenHashSet();
|
||||||
@@ -271,7 +289,7 @@
|
@@ -368,7 +373,7 @@
|
||||||
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.futures.get(i);
|
|
||||||
|
|
||||||
if (completablefuture != null) {
|
|
||||||
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either) completablefuture.getNow((Object) null);
|
|
||||||
+ Either<IChunkAccess, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
||||||
boolean flag = either != null && either.right().isPresent();
|
|
||||||
|
|
||||||
if (!flag) {
|
|
||||||
@@ -348,7 +366,7 @@
|
|
||||||
this.pendingFullStateConfirmation = completablefuture1;
|
this.pendingFullStateConfirmation = completablefuture1;
|
||||||
completablefuture.thenAccept((either) -> {
|
completablefuture.thenAccept((either) -> {
|
||||||
either.ifLeft((chunk) -> {
|
either.ifLeft((chunk) -> {
|
||||||
@ -83,7 +64,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -365,6 +383,30 @@
|
@@ -385,6 +390,30 @@
|
||||||
boolean flag1 = this.ticketLevel <= PlayerChunkMap.MAX_CHUNK_DISTANCE;
|
boolean flag1 = this.ticketLevel <= PlayerChunkMap.MAX_CHUNK_DISTANCE;
|
||||||
PlayerChunk.State playerchunk_state = getFullChunkStatus(this.oldTicketLevel);
|
PlayerChunk.State playerchunk_state = getFullChunkStatus(this.oldTicketLevel);
|
||||||
PlayerChunk.State playerchunk_state1 = getFullChunkStatus(this.ticketLevel);
|
PlayerChunk.State playerchunk_state1 = getFullChunkStatus(this.ticketLevel);
|
||||||
@ -103,7 +84,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }).exceptionally((throwable) -> {
|
+ }).exceptionally((throwable) -> {
|
||||||
+ // ensure exceptions are printed, by default this is not the case
|
+ // ensure exceptions are printed, by default this is not the case
|
||||||
+ MinecraftServer.LOGGER.fatal("Failed to schedule unload callback for chunk " + PlayerChunk.this.pos, throwable);
|
+ MinecraftServer.LOGGER.error("Failed to schedule unload callback for chunk " + PlayerChunk.this.pos, throwable);
|
||||||
+ return null;
|
+ return null;
|
||||||
+ });
|
+ });
|
||||||
+
|
+
|
||||||
@ -114,7 +95,7 @@
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
Either<IChunkAccess, PlayerChunk.Failure> either = Either.right(new PlayerChunk.Failure() {
|
Either<IChunkAccess, PlayerChunk.Failure> either = Either.right(new PlayerChunk.Failure() {
|
||||||
@@ -435,6 +477,26 @@
|
@@ -455,6 +484,26 @@
|
||||||
|
|
||||||
this.onLevelChange.onLevelChange(this.pos, this::getQueueLevel, this.ticketLevel, this::setQueueLevel);
|
this.onLevelChange.onLevelChange(this.pos, this::getQueueLevel, this.ticketLevel, this::setQueueLevel);
|
||||||
this.oldTicketLevel = this.ticketLevel;
|
this.oldTicketLevel = this.ticketLevel;
|
||||||
@ -130,7 +111,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }).exceptionally((throwable) -> {
|
+ }).exceptionally((throwable) -> {
|
||||||
+ // ensure exceptions are printed, by default this is not the case
|
+ // ensure exceptions are printed, by default this is not the case
|
||||||
+ MinecraftServer.LOGGER.fatal("Failed to schedule load callback for chunk " + PlayerChunk.this.pos, throwable);
|
+ MinecraftServer.LOGGER.error("Failed to schedule load callback for chunk " + PlayerChunk.this.pos, throwable);
|
||||||
+ return null;
|
+ return null;
|
||||||
+ });
|
+ });
|
||||||
+
|
+
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/level/PlayerChunkMap.java
|
--- a/net/minecraft/server/level/PlayerChunkMap.java
|
||||||
+++ b/net/minecraft/server/level/PlayerChunkMap.java
|
+++ b/net/minecraft/server/level/PlayerChunkMap.java
|
||||||
@@ -96,6 +96,11 @@
|
@@ -98,6 +98,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.commons.lang3.mutable.MutableObject;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.level.levelgen.GeneratorSettings;
|
+import net.minecraft.world.level.levelgen.GeneratorSettings;
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.e {
|
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.e {
|
||||||
|
|
||||||
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
|
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
|
||||||
@@ -135,6 +140,27 @@
|
@@ -139,6 +144,27 @@
|
||||||
private final Queue<Runnable> unloadQueue;
|
private final Queue<Runnable> unloadQueue;
|
||||||
int viewDistance;
|
int viewDistance;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@
|
|||||||
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
||||||
super(convertable_conversionsession.getDimensionPath(worldserver.dimension()).resolve("region"), datafixer, flag);
|
super(convertable_conversionsession.getDimensionPath(worldserver.dimension()).resolve("region"), datafixer, flag);
|
||||||
this.visibleChunkMap = this.updatingChunkMap.clone();
|
this.visibleChunkMap = this.updatingChunkMap.clone();
|
||||||
@@ -291,9 +317,12 @@
|
@@ -296,9 +322,12 @@
|
||||||
CompletableFuture<List<Either<IChunkAccess, PlayerChunk.Failure>>> completablefuture1 = SystemUtils.sequence(list);
|
CompletableFuture<List<Either<IChunkAccess, PlayerChunk.Failure>>> completablefuture1 = SystemUtils.sequence(list);
|
||||||
CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> completablefuture2 = completablefuture1.thenApply((list2) -> {
|
CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> completablefuture2 = completablefuture1.thenApply((list2) -> {
|
||||||
List<IChunkAccess> list3 = Lists.newArrayList();
|
List<IChunkAccess> list3 = Lists.newArrayList();
|
||||||
@ -53,9 +53,9 @@
|
|||||||
+ final int l1 = cnt;
|
+ final int l1 = cnt;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
||||||
Optional<IChunkAccess> optional = either.left();
|
|
||||||
|
|
||||||
@@ -463,7 +492,7 @@
|
if (either == null) {
|
||||||
|
@@ -503,7 +532,7 @@
|
||||||
|
|
||||||
private void scheduleUnload(long i, PlayerChunk playerchunk) {
|
private void scheduleUnload(long i, PlayerChunk playerchunk) {
|
||||||
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkToSave();
|
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkToSave();
|
||||||
@ -64,7 +64,7 @@
|
|||||||
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkToSave();
|
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkToSave();
|
||||||
|
|
||||||
if (completablefuture1 != completablefuture) {
|
if (completablefuture1 != completablefuture) {
|
||||||
@@ -642,7 +671,21 @@
|
@@ -683,7 +712,21 @@
|
||||||
|
|
||||||
private static void postLoadProtoChunk(WorldServer worldserver, List<NBTTagCompound> list) {
|
private static void postLoadProtoChunk(WorldServer worldserver, List<NBTTagCompound> list) {
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
@ -87,7 +87,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -740,7 +783,7 @@
|
@@ -782,7 +825,7 @@
|
||||||
if (!playerchunk.wasAccessibleSinceLastSave()) {
|
if (!playerchunk.wasAccessibleSinceLastSave()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
if (!(ichunkaccess instanceof ProtoChunkExtension) && !(ichunkaccess instanceof Chunk)) {
|
if (!(ichunkaccess instanceof ProtoChunkExtension) && !(ichunkaccess instanceof Chunk)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -890,7 +933,8 @@
|
@@ -944,7 +987,8 @@
|
||||||
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -106,7 +106,7 @@
|
|||||||
return chunk.getBlockEntities().size();
|
return chunk.getBlockEntities().size();
|
||||||
}).orElse(0), tickingtracker.getTicketDebugString(i), tickingtracker.getLevel(i), optional1.map((chunk) -> {
|
}).orElse(0), tickingtracker.getTicketDebugString(i), tickingtracker.getLevel(i), optional1.map((chunk) -> {
|
||||||
return chunk.getBlockTicks().count();
|
return chunk.getBlockTicks().count();
|
||||||
@@ -903,7 +947,7 @@
|
@@ -957,7 +1001,7 @@
|
||||||
|
|
||||||
private static String printFuture(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
private static String printFuture(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
||||||
try {
|
try {
|
||||||
@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
return either != null ? (String) either.map((chunk) -> {
|
return either != null ? (String) either.map((chunk) -> {
|
||||||
return "done";
|
return "done";
|
||||||
@@ -921,7 +965,7 @@
|
@@ -975,7 +1019,7 @@
|
||||||
private NBTTagCompound readChunk(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
private NBTTagCompound readChunk(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||||
|
|
||||||
@ -124,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean anyPlayerCloseEnoughForSpawning(ChunkCoordIntPair chunkcoordintpair) {
|
boolean anyPlayerCloseEnoughForSpawning(ChunkCoordIntPair chunkcoordintpair) {
|
||||||
@@ -1342,7 +1386,7 @@
|
@@ -1396,7 +1440,7 @@
|
||||||
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
||||||
|
|
||||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||||
@ -133,7 +133,7 @@
|
|||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.range = i;
|
this.range = i;
|
||||||
this.lastSectionPos = SectionPosition.of(entity);
|
this.lastSectionPos = SectionPosition.of(entity);
|
||||||
@@ -1395,12 +1439,17 @@
|
@@ -1449,12 +1493,17 @@
|
||||||
|
|
||||||
public void updatePlayer(EntityPlayer entityplayer) {
|
public void updatePlayer(EntityPlayer entityplayer) {
|
||||||
if (entityplayer != this.entity) {
|
if (entityplayer != this.entity) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/level/PlayerInteractManager.java
|
--- a/net/minecraft/server/level/PlayerInteractManager.java
|
||||||
+++ b/net/minecraft/server/level/PlayerInteractManager.java
|
+++ b/net/minecraft/server/level/PlayerInteractManager.java
|
||||||
@@ -24,6 +24,27 @@
|
@@ -26,6 +26,27 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
@ -27,8 +27,8 @@
|
|||||||
+
|
+
|
||||||
public class PlayerInteractManager {
|
public class PlayerInteractManager {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -54,6 +75,13 @@
|
@@ -56,6 +77,13 @@
|
||||||
if (enumgamemode == this.gameModeForPlayer) {
|
if (enumgamemode == this.gameModeForPlayer) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -42,7 +42,7 @@
|
|||||||
this.setGameModeForPlayer(enumgamemode, this.gameModeForPlayer);
|
this.setGameModeForPlayer(enumgamemode, this.gameModeForPlayer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -64,7 +92,7 @@
|
@@ -66,7 +94,7 @@
|
||||||
this.gameModeForPlayer = enumgamemode;
|
this.gameModeForPlayer = enumgamemode;
|
||||||
enumgamemode.updatePlayerAbilities(this.player.getAbilities());
|
enumgamemode.updatePlayerAbilities(this.player.getAbilities());
|
||||||
this.player.onUpdateAbilities();
|
this.player.onUpdateAbilities();
|
||||||
@ -51,7 +51,7 @@
|
|||||||
this.level.updateSleepingPlayerList();
|
this.level.updateSleepingPlayerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +114,7 @@
|
@@ -88,7 +116,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@ -60,7 +60,7 @@
|
|||||||
IBlockData iblockdata;
|
IBlockData iblockdata;
|
||||||
|
|
||||||
if (this.hasDelayedDestroy) {
|
if (this.hasDelayedDestroy) {
|
||||||
@@ -142,10 +170,32 @@
|
@@ -152,10 +180,32 @@
|
||||||
|
|
||||||
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
|
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
|
||||||
if (!this.level.mayInteract(this.player, blockposition)) {
|
if (!this.level.mayInteract(this.player, blockposition)) {
|
||||||
@ -93,11 +93,11 @@
|
|||||||
if (this.isCreative()) {
|
if (this.isCreative()) {
|
||||||
this.destroyAndAck(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy");
|
this.destroyAndAck(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy");
|
||||||
return;
|
return;
|
||||||
@@ -160,11 +210,43 @@
|
@@ -170,11 +220,43 @@
|
||||||
float f = 1.0F;
|
float f = 1.0F;
|
||||||
|
|
||||||
iblockdata = this.level.getBlockState(blockposition);
|
iblockdata1 = this.level.getBlockState(blockposition);
|
||||||
- if (!iblockdata.isAir()) {
|
- if (!iblockdata1.isAir()) {
|
||||||
+ // CraftBukkit start - Swings at air do *NOT* exist.
|
+ // CraftBukkit start - Swings at air do *NOT* exist.
|
||||||
+ if (event.useInteractedBlock() == Event.Result.DENY) {
|
+ if (event.useInteractedBlock() == Event.Result.DENY) {
|
||||||
+ // If we denied a door from opening, we need to send a correcting update to the client, as it already opened the door.
|
+ // If we denied a door from opening, we need to send a correcting update to the client, as it already opened the door.
|
||||||
@ -110,9 +110,9 @@
|
|||||||
+ } else if (data.getBlock() instanceof BlockTrapdoor) {
|
+ } else if (data.getBlock() instanceof BlockTrapdoor) {
|
||||||
+ this.player.connection.send(new PacketPlayOutBlockChange(this.level, blockposition));
|
+ this.player.connection.send(new PacketPlayOutBlockChange(this.level, blockposition));
|
||||||
+ }
|
+ }
|
||||||
+ } else if (!iblockdata.isAir()) {
|
+ } else if (!iblockdata1.isAir()) {
|
||||||
iblockdata.attack(this.level, blockposition, this.player);
|
iblockdata1.attack(this.level, blockposition, this.player);
|
||||||
f = iblockdata.getDestroyProgress(this.player, this.player.level, blockposition);
|
f = iblockdata1.getDestroyProgress(this.player, this.player.level, blockposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ if (event.useItemInHand() == Event.Result.DENY) {
|
+ if (event.useItemInHand() == Event.Result.DENY) {
|
||||||
@ -135,10 +135,10 @@
|
|||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
if (!iblockdata.isAir() && f >= 1.0F) {
|
if (!iblockdata1.isAir() && f >= 1.0F) {
|
||||||
this.destroyAndAck(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine");
|
this.destroyAndAck(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine");
|
||||||
} else {
|
} else {
|
||||||
@@ -208,13 +290,15 @@
|
@@ -218,13 +300,15 @@
|
||||||
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
|
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
|
||||||
this.isDestroyingBlock = false;
|
this.isDestroyingBlock = false;
|
||||||
if (!Objects.equals(this.destroyPos, blockposition)) {
|
if (!Objects.equals(this.destroyPos, blockposition)) {
|
||||||
@ -155,7 +155,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -224,17 +308,72 @@
|
@@ -234,17 +318,72 @@
|
||||||
if (this.destroyBlock(blockposition)) {
|
if (this.destroyBlock(blockposition)) {
|
||||||
this.player.connection.send(new PacketPlayOutBlockBreak(blockposition, this.level.getBlockState(blockposition), packetplayinblockdig_enumplayerdigtype, true, s));
|
this.player.connection.send(new PacketPlayOutBlockBreak(blockposition, this.level.getBlockState(blockposition), packetplayinblockdig_enumplayerdigtype, true, s));
|
||||||
} else {
|
} else {
|
||||||
@ -230,7 +230,7 @@
|
|||||||
TileEntity tileentity = this.level.getBlockEntity(blockposition);
|
TileEntity tileentity = this.level.getBlockEntity(blockposition);
|
||||||
Block block = iblockdata.getBlock();
|
Block block = iblockdata.getBlock();
|
||||||
|
|
||||||
@@ -244,6 +383,10 @@
|
@@ -254,6 +393,10 @@
|
||||||
} else if (this.player.blockActionRestricted(this.level, blockposition, this.gameModeForPlayer)) {
|
} else if (this.player.blockActionRestricted(this.level, blockposition, this.gameModeForPlayer)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -241,7 +241,7 @@
|
|||||||
block.playerWillDestroy(this.level, blockposition, iblockdata, this.player);
|
block.playerWillDestroy(this.level, blockposition, iblockdata, this.player);
|
||||||
boolean flag = this.level.removeBlock(blockposition, false);
|
boolean flag = this.level.removeBlock(blockposition, false);
|
||||||
|
|
||||||
@@ -252,19 +395,32 @@
|
@@ -262,19 +405,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isCreative()) {
|
if (this.isCreative()) {
|
||||||
@ -277,7 +277,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,12 +462,52 @@
|
@@ -316,12 +472,52 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +330,7 @@
|
|||||||
|
|
||||||
if (itileinventory != null) {
|
if (itileinventory != null) {
|
||||||
entityplayer.openMenu(itileinventory);
|
entityplayer.openMenu(itileinventory);
|
||||||
@@ -325,7 +521,7 @@
|
@@ -335,7 +531,7 @@
|
||||||
ItemStack itemstack1 = itemstack.copy();
|
ItemStack itemstack1 = itemstack.copy();
|
||||||
|
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
@ -339,7 +339,7 @@
|
|||||||
|
|
||||||
if (enuminteractionresult.consumesAction()) {
|
if (enuminteractionresult.consumesAction()) {
|
||||||
CriterionTriggers.ITEM_USED_ON_BLOCK.trigger(entityplayer, blockposition, itemstack1);
|
CriterionTriggers.ITEM_USED_ON_BLOCK.trigger(entityplayer, blockposition, itemstack1);
|
||||||
@@ -333,17 +529,17 @@
|
@@ -343,17 +539,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +360,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (enuminteractionresult1.consumesAction()) {
|
if (enuminteractionresult1.consumesAction()) {
|
||||||
@@ -351,10 +547,10 @@
|
@@ -361,10 +557,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return enuminteractionresult1;
|
return enuminteractionresult1;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/level/RegionLimitedWorldAccess.java
|
--- a/net/minecraft/server/level/RegionLimitedWorldAccess.java
|
||||||
+++ b/net/minecraft/server/level/RegionLimitedWorldAccess.java
|
+++ b/net/minecraft/server/level/RegionLimitedWorldAccess.java
|
||||||
@@ -200,7 +200,7 @@
|
@@ -199,7 +199,7 @@
|
||||||
if (iblockdata.isAir()) {
|
if (iblockdata.isAir()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
TileEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(blockposition) : null;
|
TileEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(blockposition) : null;
|
||||||
|
|
||||||
Block.dropResources(iblockdata, this.level, blockposition, tileentity, entity, ItemStack.EMPTY);
|
Block.dropResources(iblockdata, this.level, blockposition, tileentity, entity, ItemStack.EMPTY);
|
||||||
@@ -319,6 +319,13 @@
|
@@ -318,6 +318,13 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addFreshEntity(Entity entity) {
|
public boolean addFreshEntity(Entity entity) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/level/WorldServer.java
|
--- a/net/minecraft/server/level/WorldServer.java
|
||||||
+++ b/net/minecraft/server/level/WorldServer.java
|
+++ b/net/minecraft/server/level/WorldServer.java
|
||||||
@@ -149,6 +149,20 @@
|
@@ -150,6 +150,20 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.ticks.TickListServer;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.entity.monster.EntityDrowned;
|
+import net.minecraft.world.entity.monster.EntityDrowned;
|
||||||
@ -21,7 +21,7 @@
|
|||||||
public class WorldServer extends World implements GeneratorAccessSeed {
|
public class WorldServer extends World implements GeneratorAccessSeed {
|
||||||
|
|
||||||
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
||||||
@@ -166,7 +180,7 @@
|
@@ -167,7 +181,7 @@
|
||||||
final List<EntityPlayer> players;
|
final List<EntityPlayer> players;
|
||||||
private final ChunkProviderServer chunkSource;
|
private final ChunkProviderServer chunkSource;
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
@ -30,13 +30,13 @@
|
|||||||
final EntityTickList entityTickList;
|
final EntityTickList entityTickList;
|
||||||
public final PersistentEntitySectionManager<Entity> entityManager;
|
public final PersistentEntitySectionManager<Entity> entityManager;
|
||||||
public boolean noSave;
|
public boolean noSave;
|
||||||
@@ -189,9 +203,29 @@
|
@@ -190,9 +204,29 @@
|
||||||
private final StructureCheck structureCheck;
|
private final StructureCheck structureCheck;
|
||||||
private final boolean tickTime;
|
private final boolean tickTime;
|
||||||
|
|
||||||
- public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1) {
|
- public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1) {
|
||||||
- Objects.requireNonNull(minecraftserver);
|
- Objects.requireNonNull(minecraftserver);
|
||||||
- super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getProfiler, false, flag, i);
|
- super(iworlddataserver, resourcekey, holder, minecraftserver::getProfiler, false, flag, i);
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ private int tickPosition;
|
+ private int tickPosition;
|
||||||
@ -53,9 +53,9 @@
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // Add env and gen to constructor, WorldData -> WorldDataServer
|
+ // Add env and gen to constructor, WorldData -> WorldDataServer
|
||||||
+ public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
+ public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||||
+ // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
+ // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||||
+ super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getProfiler, false, flag, i, gen, biomeProvider, env);
|
+ super(iworlddataserver, resourcekey, holder, minecraftserver::getProfiler, false, flag, i, gen, biomeProvider, env);
|
||||||
+ this.pvpMode = minecraftserver.isPvpAllowed();
|
+ this.pvpMode = minecraftserver.isPvpAllowed();
|
||||||
+ convertable = convertable_conversionsession;
|
+ convertable = convertable_conversionsession;
|
||||||
+ uuid = WorldUUID.getUUID(convertable_conversionsession.levelPath.toFile());
|
+ uuid = WorldUUID.getUUID(convertable_conversionsession.levelPath.toFile());
|
||||||
@ -63,7 +63,7 @@
|
|||||||
this.players = Lists.newArrayList();
|
this.players = Lists.newArrayList();
|
||||||
this.entityTickList = new EntityTickList();
|
this.entityTickList = new EntityTickList();
|
||||||
this.blockTicks = new TickListServer<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
this.blockTicks = new TickListServer<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||||
@@ -203,7 +237,13 @@
|
@@ -204,7 +238,13 @@
|
||||||
this.tickTime = flag1;
|
this.tickTime = flag1;
|
||||||
this.server = minecraftserver;
|
this.server = minecraftserver;
|
||||||
this.customSpawners = list;
|
this.customSpawners = list;
|
||||||
@ -75,10 +75,10 @@
|
|||||||
+ chunkgenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkgenerator, gen);
|
+ chunkgenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkgenerator, gen);
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
chunkgenerator.ensureStructuresGenerated();
|
||||||
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
||||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||||
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);
|
@@ -236,14 +276,15 @@
|
||||||
@@ -234,14 +274,15 @@
|
|
||||||
long l = minecraftserver.getWorldData().worldGenSettings().seed();
|
long l = minecraftserver.getWorldData().worldGenSettings().seed();
|
||||||
|
|
||||||
this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer);
|
this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer);
|
||||||
@ -96,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setWeatherParameters(int i, int j, boolean flag, boolean flag1) {
|
public void setWeatherParameters(int i, int j, boolean flag, boolean flag1) {
|
||||||
@@ -273,12 +314,20 @@
|
@@ -275,12 +316,20 @@
|
||||||
long j;
|
long j;
|
||||||
|
|
||||||
if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||||
@ -120,7 +120,7 @@
|
|||||||
if (this.getGameRules().getBoolean(GameRules.RULE_WEATHER_CYCLE) && this.isRaining()) {
|
if (this.getGameRules().getBoolean(GameRules.RULE_WEATHER_CYCLE) && this.isRaining()) {
|
||||||
this.resetWeatherCycle();
|
this.resetWeatherCycle();
|
||||||
}
|
}
|
||||||
@@ -304,7 +353,7 @@
|
@@ -306,7 +355,7 @@
|
||||||
this.runBlockEvents();
|
this.runBlockEvents();
|
||||||
this.handlingTick = false;
|
this.handlingTick = false;
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.resetEmptyTime();
|
this.resetEmptyTime();
|
||||||
@@ -320,7 +369,7 @@
|
@@ -322,7 +371,7 @@
|
||||||
|
|
||||||
this.entityTickList.forEach((entity) -> {
|
this.entityTickList.forEach((entity) -> {
|
||||||
if (!entity.isRemoved()) {
|
if (!entity.isRemoved()) {
|
||||||
@ -138,7 +138,7 @@
|
|||||||
entity.discard();
|
entity.discard();
|
||||||
} else {
|
} else {
|
||||||
gameprofilerfiller.push("checkDespawn");
|
gameprofilerfiller.push("checkDespawn");
|
||||||
@@ -392,7 +441,7 @@
|
@@ -394,7 +443,7 @@
|
||||||
|
|
||||||
private void wakeUpAllPlayers() {
|
private void wakeUpAllPlayers() {
|
||||||
this.sleepStatus.removeAllSleepers();
|
this.sleepStatus.removeAllSleepers();
|
||||||
@ -147,7 +147,7 @@
|
|||||||
entityplayer.stopSleepInBed(false, false);
|
entityplayer.stopSleepInBed(false, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -419,14 +468,14 @@
|
@@ -421,14 +470,14 @@
|
||||||
entityhorseskeleton.setTrap(true);
|
entityhorseskeleton.setTrap(true);
|
||||||
entityhorseskeleton.setAge(0);
|
entityhorseskeleton.setAge(0);
|
||||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||||
@ -164,8 +164,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,12 +486,12 @@
|
@@ -439,12 +488,12 @@
|
||||||
BiomeBase biomebase = this.getBiome(blockposition);
|
BiomeBase biomebase = (BiomeBase) this.getBiome(blockposition).value();
|
||||||
|
|
||||||
if (biomebase.shouldFreeze(this, blockposition1)) {
|
if (biomebase.shouldFreeze(this, blockposition1)) {
|
||||||
- this.setBlockAndUpdate(blockposition1, Blocks.ICE.defaultBlockState());
|
- this.setBlockAndUpdate(blockposition1, Blocks.ICE.defaultBlockState());
|
||||||
@ -179,7 +179,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
IBlockData iblockdata = this.getBlockState(blockposition1);
|
IBlockData iblockdata = this.getBlockState(blockposition1);
|
||||||
@@ -638,6 +687,7 @@
|
@@ -640,6 +689,7 @@
|
||||||
this.rainLevel = MathHelper.clamp(this.rainLevel, 0.0F, 1.0F);
|
this.rainLevel = MathHelper.clamp(this.rainLevel, 0.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@
|
|||||||
if (this.oRainLevel != this.rainLevel) {
|
if (this.oRainLevel != this.rainLevel) {
|
||||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel), this.dimension());
|
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel), this.dimension());
|
||||||
}
|
}
|
||||||
@@ -656,14 +706,47 @@
|
@@ -658,14 +708,47 @@
|
||||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel));
|
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel));
|
||||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.THUNDER_LEVEL_CHANGE, this.thunderLevel));
|
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.THUNDER_LEVEL_CHANGE, this.thunderLevel));
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void resetEmptyTime() {
|
public void resetEmptyTime() {
|
||||||
@@ -698,6 +781,7 @@
|
@@ -700,6 +783,7 @@
|
||||||
});
|
});
|
||||||
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
||||||
entity.tick();
|
entity.tick();
|
||||||
@ -245,7 +245,7 @@
|
|||||||
this.getProfiler().pop();
|
this.getProfiler().pop();
|
||||||
Iterator iterator = entity.getPassengers().iterator();
|
Iterator iterator = entity.getPassengers().iterator();
|
||||||
|
|
||||||
@@ -721,6 +805,7 @@
|
@@ -723,6 +807,7 @@
|
||||||
});
|
});
|
||||||
gameprofilerfiller.incrementCounter("tickPassenger");
|
gameprofilerfiller.incrementCounter("tickPassenger");
|
||||||
entity1.rideTick();
|
entity1.rideTick();
|
||||||
@ -253,7 +253,7 @@
|
|||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
Iterator iterator = entity1.getPassengers().iterator();
|
Iterator iterator = entity1.getPassengers().iterator();
|
||||||
|
|
||||||
@@ -745,6 +830,7 @@
|
@@ -747,6 +832,7 @@
|
||||||
ChunkProviderServer chunkproviderserver = this.getChunkSource();
|
ChunkProviderServer chunkproviderserver = this.getChunkSource();
|
||||||
|
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
@ -261,7 +261,7 @@
|
|||||||
if (iprogressupdate != null) {
|
if (iprogressupdate != null) {
|
||||||
iprogressupdate.progressStartNoAbort(new ChatMessage("menu.savingLevel"));
|
iprogressupdate.progressStartNoAbort(new ChatMessage("menu.savingLevel"));
|
||||||
}
|
}
|
||||||
@@ -762,11 +848,19 @@
|
@@ -764,11 +850,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.getChunkSource().getDataStorage().save();
|
this.getChunkSource().getDataStorage().save();
|
||||||
@@ -812,15 +906,34 @@
|
@@ -814,15 +908,34 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addFreshEntity(Entity entity) {
|
public boolean addFreshEntity(Entity entity) {
|
||||||
@ -320,7 +320,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addDuringCommandTeleport(EntityPlayer entityplayer) {
|
public void addDuringCommandTeleport(EntityPlayer entityplayer) {
|
||||||
@@ -851,24 +964,36 @@
|
@@ -853,24 +966,36 @@
|
||||||
this.entityManager.addNewEntity(entityplayer);
|
this.entityManager.addNewEntity(entityplayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,7 +361,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -882,10 +1007,32 @@
|
@@ -884,10 +1009,32 @@
|
||||||
entityplayer.remove(entity_removalreason);
|
entityplayer.remove(entity_removalreason);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||||
|
|
||||||
@@ -894,6 +1041,12 @@
|
@@ -896,6 +1043,12 @@
|
||||||
double d1 = (double) blockposition.getY() - entityplayer.getY();
|
double d1 = (double) blockposition.getY() - entityplayer.getY();
|
||||||
double d2 = (double) blockposition.getZ() - entityplayer.getZ();
|
double d2 = (double) blockposition.getZ() - entityplayer.getZ();
|
||||||
|
|
||||||
@ -407,7 +407,7 @@
|
|||||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||||
entityplayer.connection.send(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
entityplayer.connection.send(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
||||||
}
|
}
|
||||||
@@ -948,7 +1101,18 @@
|
@@ -950,7 +1103,18 @@
|
||||||
Iterator iterator = this.navigatingMobs.iterator();
|
Iterator iterator = this.navigatingMobs.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@ -427,7 +427,7 @@
|
|||||||
NavigationAbstract navigationabstract = entityinsentient.getNavigation();
|
NavigationAbstract navigationabstract = entityinsentient.getNavigation();
|
||||||
|
|
||||||
if (navigationabstract.shouldRecomputePath(blockposition)) {
|
if (navigationabstract.shouldRecomputePath(blockposition)) {
|
||||||
@@ -984,10 +1148,20 @@
|
@@ -986,10 +1150,20 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Explosion explode(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
|
public Explosion explode(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
|
||||||
@ -448,7 +448,7 @@
|
|||||||
if (explosion_effect == Explosion.Effect.NONE) {
|
if (explosion_effect == Explosion.Effect.NONE) {
|
||||||
explosion.clearToBlow();
|
explosion.clearToBlow();
|
||||||
}
|
}
|
||||||
@@ -1068,13 +1242,20 @@
|
@@ -1070,13 +1244,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends ParticleParam> int sendParticles(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
public <T extends ParticleParam> int sendParticles(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
||||||
@ -471,16 +471,16 @@
|
|||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1125,7 +1306,7 @@
|
@@ -1127,7 +1308,7 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public BlockPosition findNearestMapFeature(StructureGenerator<?> structuregenerator, BlockPosition blockposition, int i, boolean flag) {
|
public BlockPosition findNearestMapFeature(TagKey<StructureFeature<?, ?>> tagkey, BlockPosition blockposition, int i, boolean flag) {
|
||||||
- return !this.server.getWorldData().worldGenSettings().generateFeatures() ? null : this.getChunkSource().getGenerator().findNearestMapFeature(this, structuregenerator, blockposition, i, flag);
|
- if (!this.server.getWorldData().worldGenSettings().generateFeatures()) {
|
||||||
+ return !this.serverLevelData.worldGenSettings().generateFeatures() ? null : this.getChunkSource().getGenerator().findNearestMapFeature(this, structuregenerator, blockposition, i, flag); // CraftBukkit
|
+ if (!this.serverLevelData.worldGenSettings().generateFeatures()) { // CraftBukkit
|
||||||
}
|
return null;
|
||||||
|
} else {
|
||||||
@Nullable
|
Optional<HolderSet.Named<StructureFeature<?, ?>>> optional = this.registryAccess().registryOrThrow(IRegistry.CONFIGURED_STRUCTURE_FEATURE_REGISTRY).getTag(tagkey);
|
||||||
@@ -1162,11 +1343,21 @@
|
@@ -1169,11 +1350,21 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public WorldMap getMapData(String s) {
|
public WorldMap getMapData(String s) {
|
||||||
@ -503,7 +503,7 @@
|
|||||||
this.getServer().overworld().getDataStorage().set(s, worldmap);
|
this.getServer().overworld().getDataStorage().set(s, worldmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1478,6 +1669,11 @@
|
@@ -1485,6 +1676,11 @@
|
||||||
@Override
|
@Override
|
||||||
public void blockUpdated(BlockPosition blockposition, Block block) {
|
public void blockUpdated(BlockPosition blockposition, Block block) {
|
||||||
if (!this.isDebug()) {
|
if (!this.isDebug()) {
|
||||||
@ -515,7 +515,7 @@
|
|||||||
this.updateNeighborsAt(blockposition, block);
|
this.updateNeighborsAt(blockposition, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1497,12 +1693,12 @@
|
@@ -1504,12 +1700,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFlat() {
|
public boolean isFlat() {
|
||||||
@ -530,7 +530,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -1530,7 +1726,7 @@
|
@@ -1532,7 +1728,7 @@
|
||||||
private static <T> String getTypeCount(Iterable<T> iterable, Function<T, String> function) {
|
private static <T> String getTypeCount(Iterable<T> iterable, Function<T, String> function) {
|
||||||
try {
|
try {
|
||||||
Object2IntOpenHashMap<String> object2intopenhashmap = new Object2IntOpenHashMap();
|
Object2IntOpenHashMap<String> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||||
@ -539,7 +539,7 @@
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
T t0 = iterator.next();
|
T t0 = iterator.next();
|
||||||
@@ -1539,7 +1735,7 @@
|
@@ -1541,7 +1737,7 @@
|
||||||
object2intopenhashmap.addTo(s, 1);
|
object2intopenhashmap.addTo(s, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,7 +548,7 @@
|
|||||||
String s1 = (String) entry.getKey();
|
String s1 = (String) entry.getKey();
|
||||||
|
|
||||||
return s1 + ":" + entry.getIntValue();
|
return s1 + ":" + entry.getIntValue();
|
||||||
@@ -1550,17 +1746,33 @@
|
@@ -1552,17 +1748,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void makeObsidianPlatform(WorldServer worldserver) {
|
public static void makeObsidianPlatform(WorldServer worldserver) {
|
||||||
@ -584,7 +584,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1666,6 +1878,7 @@
|
@@ -1672,6 +1884,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +592,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onTrackingEnd(Entity entity) {
|
public void onTrackingEnd(Entity entity) {
|
||||||
@@ -1707,6 +1920,14 @@
|
@@ -1713,6 +1926,14 @@
|
||||||
gameeventlistenerregistrar.onListenerRemoved(entity.level);
|
gameeventlistenerregistrar.onListenerRemoved(entity.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/network/LoginListener.java
|
--- a/net/minecraft/server/network/LoginListener.java
|
||||||
+++ b/net/minecraft/server/network/LoginListener.java
|
+++ b/net/minecraft/server/network/LoginListener.java
|
||||||
@@ -36,6 +36,13 @@
|
@@ -36,6 +36,13 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.commons.lang3.Validate;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.network.chat.ChatComponentText;
|
+import net.minecraft.network.chat.ChatComponentText;
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
if (entityplayer != null) {
|
if (entityplayer != null) {
|
||||||
this.state = LoginListener.EnumProtocolState.DELAY_ACCEPT;
|
this.state = LoginListener.EnumProtocolState.DELAY_ACCEPT;
|
||||||
@@ -192,6 +216,43 @@
|
@@ -199,6 +223,43 @@
|
||||||
try {
|
try {
|
||||||
LoginListener.this.gameProfile = LoginListener.this.server.getSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.getAddress());
|
LoginListener.this.gameProfile = LoginListener.this.server.getSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.getAddress());
|
||||||
if (LoginListener.this.gameProfile != null) {
|
if (LoginListener.this.gameProfile != null) {
|
||||||
@ -112,7 +112,7 @@
|
|||||||
LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.gameProfile.getName(), LoginListener.this.gameProfile.getId());
|
LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.gameProfile.getName(), LoginListener.this.gameProfile.getId());
|
||||||
LoginListener.this.state = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
LoginListener.this.state = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
||||||
} else if (LoginListener.this.server.isSingleplayer()) {
|
} else if (LoginListener.this.server.isSingleplayer()) {
|
||||||
@@ -211,6 +272,11 @@
|
@@ -218,6 +279,11 @@
|
||||||
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
|
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
|
||||||
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/network/PlayerConnection.java
|
--- a/net/minecraft/server/network/PlayerConnection.java
|
||||||
+++ b/net/minecraft/server/network/PlayerConnection.java
|
+++ b/net/minecraft/server/network/PlayerConnection.java
|
||||||
@@ -156,6 +156,62 @@
|
@@ -157,6 +157,62 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import java.util.concurrent.ExecutionException;
|
+import java.util.concurrent.ExecutionException;
|
||||||
@ -62,8 +62,8 @@
|
|||||||
+
|
+
|
||||||
public class PlayerConnection implements ServerPlayerConnection, PacketListenerPlayIn {
|
public class PlayerConnection implements ServerPlayerConnection, PacketListenerPlayIn {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -167,7 +223,9 @@
|
@@ -168,7 +224,9 @@
|
||||||
private long keepAliveTime;
|
private long keepAliveTime;
|
||||||
private boolean keepAlivePending;
|
private boolean keepAlivePending;
|
||||||
private long keepAliveChallenge;
|
private long keepAliveChallenge;
|
||||||
@ -74,7 +74,7 @@
|
|||||||
private int dropSpamTickCount;
|
private int dropSpamTickCount;
|
||||||
private double firstGoodX;
|
private double firstGoodX;
|
||||||
private double firstGoodY;
|
private double firstGoodY;
|
||||||
@@ -202,7 +260,31 @@
|
@@ -203,7 +261,31 @@
|
||||||
entityplayer.connection = this;
|
entityplayer.connection = this;
|
||||||
this.keepAliveTime = SystemUtils.getMillis();
|
this.keepAliveTime = SystemUtils.getMillis();
|
||||||
entityplayer.getTextFilter().join();
|
entityplayer.getTextFilter().join();
|
||||||
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
this.resetPosition();
|
this.resetPosition();
|
||||||
@@ -251,7 +333,7 @@
|
@@ -252,7 +334,7 @@
|
||||||
this.server.getProfiler().push("keepAlive");
|
this.server.getProfiler().push("keepAlive");
|
||||||
long i = SystemUtils.getMillis();
|
long i = SystemUtils.getMillis();
|
||||||
|
|
||||||
@ -115,7 +115,7 @@
|
|||||||
if (this.keepAlivePending) {
|
if (this.keepAlivePending) {
|
||||||
this.disconnect(new ChatMessage("disconnect.timeout"));
|
this.disconnect(new ChatMessage("disconnect.timeout"));
|
||||||
} else {
|
} else {
|
||||||
@@ -263,15 +345,21 @@
|
@@ -264,15 +346,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.server.getProfiler().pop();
|
this.server.getProfiler().pop();
|
||||||
@ -137,7 +137,7 @@
|
|||||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,16 +383,46 @@
|
@@ -296,16 +384,46 @@
|
||||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T, R> void filterTextPacket(T t0, Consumer<R> consumer, BiFunction<ITextFilter, T, CompletableFuture<R>> bifunction) {
|
private <T, R> void filterTextPacket(T t0, Consumer<R> consumer, BiFunction<ITextFilter, T, CompletableFuture<R>> bifunction) {
|
||||||
@@ -371,7 +489,34 @@
|
@@ -376,7 +494,34 @@
|
||||||
double d9 = entity.getDeltaMovement().lengthSqr();
|
double d9 = entity.getDeltaMovement().lengthSqr();
|
||||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||||
|
|
||||||
@ -218,17 +218,17 @@
|
|||||||
+
|
+
|
||||||
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName().getString(), this.player.getName().getString(), d6, d7, d8);
|
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
|
||||||
this.connection.send(new PacketPlayOutVehicleMove(entity));
|
this.connection.send(new PacketPlayOutVehicleMove(entity));
|
||||||
return;
|
return;
|
||||||
@@ -401,14 +546,72 @@
|
@@ -408,14 +553,72 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.absMoveTo(d3, d4, d5, f, f1);
|
entity.absMoveTo(d3, d4, d5, f, f1);
|
||||||
+ player.absMoveTo(d3, d4, d5, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
+ player.absMoveTo(d3, d4, d5, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
||||||
boolean flag2 = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D));
|
boolean flag3 = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D));
|
||||||
|
|
||||||
if (flag && (flag1 || !flag2)) {
|
if (flag && (flag2 || !flag3)) {
|
||||||
entity.absMoveTo(d0, d1, d2, f, f1);
|
entity.absMoveTo(d0, d1, d2, f, f1);
|
||||||
+ player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
+ player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
|
||||||
this.connection.send(new PacketPlayOutVehicleMove(entity));
|
this.connection.send(new PacketPlayOutVehicleMove(entity));
|
||||||
@ -293,8 +293,8 @@
|
|||||||
+
|
+
|
||||||
this.player.getLevel().getChunkSource().move(this.player);
|
this.player.getLevel().getChunkSource().move(this.player);
|
||||||
this.player.checkMovementStatistics(this.player.getX() - d0, this.player.getY() - d1, this.player.getZ() - d2);
|
this.player.checkMovementStatistics(this.player.getX() - d0, this.player.getY() - d1, this.player.getZ() - d2);
|
||||||
this.clientVehicleIsFloating = d11 >= -0.03125D && !this.server.isFlightAllowed() && this.noBlocksAround(entity);
|
this.clientVehicleIsFloating = d11 >= -0.03125D && !flag1 && !this.server.isFlightAllowed() && !entity.isNoGravity() && this.noBlocksAround(entity);
|
||||||
@@ -427,7 +630,7 @@
|
@@ -434,7 +637,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleAcceptTeleportPacket(PacketPlayInTeleportAccept packetplayinteleportaccept) {
|
public void handleAcceptTeleportPacket(PacketPlayInTeleportAccept packetplayinteleportaccept) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinteleportaccept, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinteleportaccept, this, this.player.getLevel());
|
||||||
@ -303,7 +303,7 @@
|
|||||||
this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||||
@@ -437,6 +640,7 @@
|
@@ -444,6 +647,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.awaitingPositionFromClient = null;
|
this.awaitingPositionFromClient = null;
|
||||||
@ -311,7 +311,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -444,7 +648,7 @@
|
@@ -451,7 +655,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleRecipeBookSeenRecipePacket(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
public void handleRecipeBookSeenRecipePacket(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipedisplayed, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipedisplayed, this, this.player.getLevel());
|
||||||
@ -320,7 +320,7 @@
|
|||||||
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
||||||
|
|
||||||
Objects.requireNonNull(recipebookserver);
|
Objects.requireNonNull(recipebookserver);
|
||||||
@@ -474,6 +678,12 @@
|
@@ -481,6 +685,12 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleCustomCommandSuggestions(PacketPlayInTabComplete packetplayintabcomplete) {
|
public void handleCustomCommandSuggestions(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayintabcomplete, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayintabcomplete, this, this.player.getLevel());
|
||||||
@ -333,7 +333,7 @@
|
|||||||
StringReader stringreader = new StringReader(packetplayintabcomplete.getCommand());
|
StringReader stringreader = new StringReader(packetplayintabcomplete.getCommand());
|
||||||
|
|
||||||
if (stringreader.canRead() && stringreader.peek() == '/') {
|
if (stringreader.canRead() && stringreader.peek() == '/') {
|
||||||
@@ -483,6 +693,7 @@
|
@@ -490,6 +700,7 @@
|
||||||
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
||||||
|
|
||||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||||
@ -341,7 +341,7 @@
|
|||||||
this.connection.send(new PacketPlayOutTabComplete(packetplayintabcomplete.getId(), suggestions));
|
this.connection.send(new PacketPlayOutTabComplete(packetplayintabcomplete.getId(), suggestions));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -715,6 +926,13 @@
|
@@ -722,6 +933,13 @@
|
||||||
|
|
||||||
if (container instanceof ContainerMerchant) {
|
if (container instanceof ContainerMerchant) {
|
||||||
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
||||||
@ -355,7 +355,7 @@
|
|||||||
|
|
||||||
containermerchant.setSelectionHint(i);
|
containermerchant.setSelectionHint(i);
|
||||||
containermerchant.tryMoveItems(i);
|
containermerchant.tryMoveItems(i);
|
||||||
@@ -724,6 +942,13 @@
|
@@ -731,6 +949,13 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEditBook(PacketPlayInBEdit packetplayinbedit) {
|
public void handleEditBook(PacketPlayInBEdit packetplayinbedit) {
|
||||||
@ -369,7 +369,7 @@
|
|||||||
int i = packetplayinbedit.getSlot();
|
int i = packetplayinbedit.getSlot();
|
||||||
|
|
||||||
if (PlayerInventory.isHotbarSlot(i) || i == 40) {
|
if (PlayerInventory.isHotbarSlot(i) || i == 40) {
|
||||||
@@ -732,7 +957,7 @@
|
@@ -739,7 +964,7 @@
|
||||||
|
|
||||||
Objects.requireNonNull(list);
|
Objects.requireNonNull(list);
|
||||||
optional.ifPresent(list::add);
|
optional.ifPresent(list::add);
|
||||||
@ -378,7 +378,7 @@
|
|||||||
|
|
||||||
Objects.requireNonNull(list);
|
Objects.requireNonNull(list);
|
||||||
stream.forEach(list::add);
|
stream.forEach(list::add);
|
||||||
@@ -748,7 +973,7 @@
|
@@ -755,7 +980,7 @@
|
||||||
ItemStack itemstack = this.player.getInventory().getItem(i);
|
ItemStack itemstack = this.player.getInventory().getItem(i);
|
||||||
|
|
||||||
if (itemstack.is(Items.WRITABLE_BOOK)) {
|
if (itemstack.is(Items.WRITABLE_BOOK)) {
|
||||||
@ -387,7 +387,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,16 +998,16 @@
|
@@ -780,16 +1005,16 @@
|
||||||
|
|
||||||
this.updateBookPages(list, (s) -> {
|
this.updateBookPages(list, (s) -> {
|
||||||
return IChatBaseComponent.ChatSerializer.toJson(new ChatComponentText(s));
|
return IChatBaseComponent.ChatSerializer.toJson(new ChatComponentText(s));
|
||||||
@ -408,7 +408,7 @@
|
|||||||
return NBTTagString.valueOf((String) unaryoperator.apply(itextfilter_a.getFiltered()));
|
return NBTTagString.valueOf((String) unaryoperator.apply(itextfilter_a.getFiltered()));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -810,6 +1035,7 @@
|
@@ -817,6 +1042,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.addTagElement("pages", nbttaglist);
|
itemstack.addTagElement("pages", nbttaglist);
|
||||||
@ -416,7 +416,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -846,7 +1072,7 @@
|
@@ -853,7 +1079,7 @@
|
||||||
} else {
|
} else {
|
||||||
WorldServer worldserver = this.player.getLevel();
|
WorldServer worldserver = this.player.getLevel();
|
||||||
|
|
||||||
@ -425,7 +425,7 @@
|
|||||||
if (this.tickCount == 0) {
|
if (this.tickCount == 0) {
|
||||||
this.resetPosition();
|
this.resetPosition();
|
||||||
}
|
}
|
||||||
@@ -856,7 +1082,7 @@
|
@@ -863,7 +1089,7 @@
|
||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||||
}
|
}
|
||||||
@ -434,7 +434,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
double d0 = clampHorizontal(packetplayinflying.getX(this.player.getX()));
|
double d0 = clampHorizontal(packetplayinflying.getX(this.player.getX()));
|
||||||
@@ -868,7 +1094,15 @@
|
@@ -875,7 +1101,15 @@
|
||||||
if (this.player.isPassenger()) {
|
if (this.player.isPassenger()) {
|
||||||
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
|
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
|
||||||
this.player.getLevel().getChunkSource().move(this.player);
|
this.player.getLevel().getChunkSource().move(this.player);
|
||||||
@ -450,7 +450,7 @@
|
|||||||
double d3 = this.player.getX();
|
double d3 = this.player.getX();
|
||||||
double d4 = this.player.getY();
|
double d4 = this.player.getY();
|
||||||
double d5 = this.player.getZ();
|
double d5 = this.player.getZ();
|
||||||
@@ -888,15 +1122,33 @@
|
@@ -895,15 +1129,33 @@
|
||||||
++this.receivedMovePacketCount;
|
++this.receivedMovePacketCount;
|
||||||
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
||||||
|
|
||||||
@ -483,22 +483,21 @@
|
|||||||
- if (d11 - d10 > (double) (f2 * (float) i) && !this.isSingleplayerOwner()) {
|
- if (d11 - d10 > (double) (f2 * (float) i) && !this.isSingleplayerOwner()) {
|
||||||
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName().getString(), d7, d8, d9);
|
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d7, d8, d9});
|
||||||
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||||
return;
|
return;
|
||||||
@@ -915,6 +1167,7 @@
|
@@ -924,6 +1176,7 @@
|
||||||
}
|
boolean flag1 = this.player.verticalCollisionBelow;
|
||||||
|
|
||||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
||||||
+ this.player.onGround = packetplayinflying.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
+ this.player.onGround = packetplayinflying.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
||||||
double d12 = d8;
|
double d12 = d8;
|
||||||
|
|
||||||
d7 = d0 - this.player.getX();
|
d7 = d0 - this.player.getX();
|
||||||
@@ -936,7 +1189,71 @@
|
@@ -945,6 +1198,69 @@
|
||||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag1 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb))) {
|
if (!this.player.noPhysics && !this.player.isSleeping() && (flag2 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb))) {
|
||||||
this.teleport(d3, d4, d5, f, f1);
|
this.teleport(d3, d4, d5, f, f1);
|
||||||
} else {
|
} else {
|
||||||
- this.clientIsFloating = d12 >= -0.03125D && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && this.noBlocksAround(this.player);
|
|
||||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||||
+ // Rest to old location first
|
+ // Rest to old location first
|
||||||
+ this.player.absMoveTo(prevX, prevY, prevZ, prevYaw, prevPitch);
|
+ this.player.absMoveTo(prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
@ -560,14 +559,12 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ this.player.absMoveTo(d0, d1, d2, f, f1); // Copied from above
|
+ this.player.absMoveTo(d0, d1, d2, f, f1); // Copied from above
|
||||||
+
|
|
||||||
+ // MC-135989, SPIGOT-5564: isRiptiding
|
|
||||||
+ this.clientIsFloating = d12 >= -0.03125D && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && this.noBlocksAround(this.player) && !this.player.isAutoSpinAttack();
|
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
|
this.clientIsFloating = d12 >= -0.03125D && !flag1 && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && !this.player.isAutoSpinAttack() && this.noBlocksAround(this.player);
|
||||||
this.player.getLevel().getChunkSource().move(this.player);
|
this.player.getLevel().getChunkSource().move(this.player);
|
||||||
this.player.doCheckFallDamage(this.player.getY() - d6, packetplayinflying.isOnGround());
|
this.player.doCheckFallDamage(this.player.getY() - d6, packetplayinflying.isOnGround());
|
||||||
this.player.setOnGround(packetplayinflying.isOnGround());
|
@@ -983,19 +1299,80 @@
|
||||||
@@ -974,19 +1291,80 @@
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,13 +628,13 @@
|
|||||||
+
|
+
|
||||||
+ this.internalTeleport(d0, d1, d2, f, f1, set, flag);
|
+ this.internalTeleport(d0, d1, d2, f, f1, set, flag);
|
||||||
+ return event.isCancelled(); // CraftBukkit - Return event status
|
+ return event.isCancelled(); // CraftBukkit - Return event status
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void teleport(Location dest) {
|
||||||
|
+ internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
- public void teleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag) {
|
- public void teleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag) {
|
||||||
+ public void teleport(Location dest) {
|
|
||||||
+ internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), true);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag) {
|
+ private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (Float.isNaN(f)) {
|
+ if (Float.isNaN(f)) {
|
||||||
@ -652,7 +649,7 @@
|
|||||||
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.getX() : 0.0D;
|
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.getX() : 0.0D;
|
||||||
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.getY() : 0.0D;
|
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.getY() : 0.0D;
|
||||||
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.getZ() : 0.0D;
|
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.getZ() : 0.0D;
|
||||||
@@ -998,6 +1376,14 @@
|
@@ -1007,6 +1384,14 @@
|
||||||
this.awaitingTeleport = 0;
|
this.awaitingTeleport = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,7 +664,7 @@
|
|||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||||
this.player.connection.send(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
this.player.connection.send(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||||
@@ -1006,6 +1392,7 @@
|
@@ -1015,6 +1400,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handlePlayerAction(PacketPlayInBlockDig packetplayinblockdig) {
|
public void handlePlayerAction(PacketPlayInBlockDig packetplayinblockdig) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockdig, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockdig, this, this.player.getLevel());
|
||||||
@ -675,7 +672,7 @@
|
|||||||
BlockPosition blockposition = packetplayinblockdig.getPos();
|
BlockPosition blockposition = packetplayinblockdig.getPos();
|
||||||
|
|
||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
@@ -1016,14 +1403,46 @@
|
@@ -1025,14 +1411,46 @@
|
||||||
if (!this.player.isSpectator()) {
|
if (!this.player.isSpectator()) {
|
||||||
ItemStack itemstack = this.player.getItemInHand(EnumHand.OFF_HAND);
|
ItemStack itemstack = this.player.getItemInHand(EnumHand.OFF_HAND);
|
||||||
|
|
||||||
@ -724,7 +721,7 @@
|
|||||||
this.player.drop(false);
|
this.player.drop(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,6 +1479,7 @@
|
@@ -1069,6 +1487,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleUseItemOn(PacketPlayInUseItem packetplayinuseitem) {
|
public void handleUseItemOn(PacketPlayInUseItem packetplayinuseitem) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseitem, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseitem, this, this.player.getLevel());
|
||||||
@ -732,25 +729,15 @@
|
|||||||
WorldServer worldserver = this.player.getLevel();
|
WorldServer worldserver = this.player.getLevel();
|
||||||
EnumHand enumhand = packetplayinuseitem.getHand();
|
EnumHand enumhand = packetplayinuseitem.getHand();
|
||||||
ItemStack itemstack = this.player.getItemInHand(enumhand);
|
ItemStack itemstack = this.player.getItemInHand(enumhand);
|
||||||
@@ -1069,9 +1489,16 @@
|
@@ -1088,6 +1507,7 @@
|
||||||
|
|
||||||
this.player.resetLastActionTime();
|
|
||||||
int i = this.player.level.getMaxBuildHeight();
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ double distanceSqr = this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D);
|
|
||||||
+ if (distanceSqr > 100.0D) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // CraftBukkit end
|
|
||||||
|
|
||||||
if (blockposition.getY() < i) {
|
if (blockposition.getY() < i) {
|
||||||
- if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) {
|
if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) {
|
||||||
+ if (this.awaitingPositionFromClient == null && distanceSqr < 64.0D && worldserver.mayInteract(this.player, blockposition)) { // CraftBukkit - reuse value
|
|
||||||
+ this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
+ this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
||||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||||
|
|
||||||
if (enumdirection == EnumDirection.UP && !enuminteractionresult.consumesAction() && blockposition.getY() >= i - 1 && wasBlockPlacementAttempt(this.player, itemstack)) {
|
if (enumdirection == EnumDirection.UP && !enuminteractionresult.consumesAction() && blockposition.getY() >= i - 1 && wasBlockPlacementAttempt(this.player, itemstack)) {
|
||||||
@@ -1095,12 +1522,51 @@
|
@@ -1117,12 +1537,51 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleUseItem(PacketPlayInBlockPlace packetplayinblockplace) {
|
public void handleUseItem(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockplace, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockplace, this, this.player.getLevel());
|
||||||
@ -802,7 +789,7 @@
|
|||||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
|
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
|
||||||
|
|
||||||
if (enuminteractionresult.shouldSwing()) {
|
if (enuminteractionresult.shouldSwing()) {
|
||||||
@@ -1121,7 +1587,7 @@
|
@@ -1143,7 +1602,7 @@
|
||||||
Entity entity = packetplayinspectate.getEntity(worldserver);
|
Entity entity = packetplayinspectate.getEntity(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
@ -811,7 +798,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1136,6 +1602,7 @@
|
@@ -1158,6 +1617,7 @@
|
||||||
PlayerConnection.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
|
PlayerConnection.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
|
||||||
this.disconnect(new ChatMessage("multiplayer.requiredTexturePrompt.disconnect"));
|
this.disconnect(new ChatMessage("multiplayer.requiredTexturePrompt.disconnect"));
|
||||||
}
|
}
|
||||||
@ -819,7 +806,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1155,11 +1622,26 @@
|
@@ -1177,11 +1637,26 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisconnect(IChatBaseComponent ichatbasecomponent) {
|
public void onDisconnect(IChatBaseComponent ichatbasecomponent) {
|
||||||
@ -847,7 +834,7 @@
|
|||||||
this.player.getTextFilter().leave();
|
this.player.getTextFilter().leave();
|
||||||
if (this.isSingleplayerOwner()) {
|
if (this.isSingleplayerOwner()) {
|
||||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||||
@@ -1174,6 +1656,15 @@
|
@@ -1196,6 +1671,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
public void send(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
||||||
@ -863,7 +850,7 @@
|
|||||||
try {
|
try {
|
||||||
this.connection.send(packet, genericfuturelistener);
|
this.connection.send(packet, genericfuturelistener);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@@ -1190,7 +1681,16 @@
|
@@ -1212,7 +1696,16 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleSetCarriedItem(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
public void handleSetCarriedItem(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinhelditemslot, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinhelditemslot, this, this.player.getLevel());
|
||||||
@ -880,7 +867,7 @@
|
|||||||
if (this.player.getInventory().selected != packetplayinhelditemslot.getSlot() && this.player.getUsedItemHand() == EnumHand.MAIN_HAND) {
|
if (this.player.getInventory().selected != packetplayinhelditemslot.getSlot() && this.player.getUsedItemHand() == EnumHand.MAIN_HAND) {
|
||||||
this.player.stopUsingItem();
|
this.player.stopUsingItem();
|
||||||
}
|
}
|
||||||
@@ -1199,11 +1699,18 @@
|
@@ -1221,11 +1714,18 @@
|
||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
} else {
|
} else {
|
||||||
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
||||||
@ -899,7 +886,7 @@
|
|||||||
String s = StringUtils.normalizeSpace(packetplayinchat.getMessage());
|
String s = StringUtils.normalizeSpace(packetplayinchat.getMessage());
|
||||||
|
|
||||||
for (int i = 0; i < s.length(); ++i) {
|
for (int i = 0; i < s.length(); ++i) {
|
||||||
@@ -1217,20 +1724,42 @@
|
@@ -1239,20 +1739,42 @@
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinchat, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinchat, this, this.player.getLevel());
|
||||||
this.handleChat(ITextFilter.a.passThrough(s));
|
this.handleChat(ITextFilter.a.passThrough(s));
|
||||||
} else {
|
} else {
|
||||||
@ -946,7 +933,7 @@
|
|||||||
} else {
|
} else {
|
||||||
String s1 = itextfilter_a.getFiltered();
|
String s1 = itextfilter_a.getFiltered();
|
||||||
ChatMessage chatmessage = s1.isEmpty() ? null : new ChatMessage("chat.type.text", new Object[]{this.player.getDisplayName(), s1});
|
ChatMessage chatmessage = s1.isEmpty() ? null : new ChatMessage("chat.type.text", new Object[]{this.player.getDisplayName(), s1});
|
||||||
@@ -1241,28 +1770,198 @@
|
@@ -1263,28 +1785,198 @@
|
||||||
}, ChatMessageType.CHAT, this.player.getUUID());
|
}, ChatMessageType.CHAT, this.player.getUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1149,7 +1136,7 @@
|
|||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
IJumpable ijumpable;
|
IJumpable ijumpable;
|
||||||
|
|
||||||
@@ -1320,6 +2019,7 @@
|
@@ -1342,6 +2034,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) {
|
public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.getLevel());
|
||||||
@ -1157,7 +1144,7 @@
|
|||||||
WorldServer worldserver = this.player.getLevel();
|
WorldServer worldserver = this.player.getLevel();
|
||||||
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
||||||
|
|
||||||
@@ -1334,10 +2034,44 @@
|
@@ -1356,10 +2049,44 @@
|
||||||
|
|
||||||
if (this.player.distanceToSqr(entity) < 36.0D) {
|
if (this.player.distanceToSqr(entity) < 36.0D) {
|
||||||
packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() {
|
packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() {
|
||||||
@ -1203,7 +1190,7 @@
|
|||||||
if (enuminteractionresult.consumesAction()) {
|
if (enuminteractionresult.consumesAction()) {
|
||||||
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, itemstack, entity);
|
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, itemstack, entity);
|
||||||
if (enuminteractionresult.shouldSwing()) {
|
if (enuminteractionresult.shouldSwing()) {
|
||||||
@@ -1349,20 +2083,27 @@
|
@@ -1371,20 +2098,27 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInteraction(EnumHand enumhand) {
|
public void onInteraction(EnumHand enumhand) {
|
||||||
@ -1234,7 +1221,7 @@
|
|||||||
} else {
|
} else {
|
||||||
PlayerConnection.this.disconnect(new ChatMessage("multiplayer.disconnect.invalid_entity_attacked"));
|
PlayerConnection.this.disconnect(new ChatMessage("multiplayer.disconnect.invalid_entity_attacked"));
|
||||||
PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getName().getString());
|
PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getName().getString());
|
||||||
@@ -1407,21 +2148,304 @@
|
@@ -1429,15 +2163,21 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) {
|
public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.getLevel());
|
||||||
@ -1257,10 +1244,12 @@
|
|||||||
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit
|
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit
|
||||||
this.player.containerMenu.sendAllDataToRemote();
|
this.player.containerMenu.sendAllDataToRemote();
|
||||||
} else {
|
} else {
|
||||||
|
int i = packetplayinwindowclick.getSlotNum();
|
||||||
|
@@ -1448,7 +2188,284 @@
|
||||||
boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId();
|
boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId();
|
||||||
|
|
||||||
this.player.containerMenu.suppressRemoteUpdates();
|
this.player.containerMenu.suppressRemoteUpdates();
|
||||||
- this.player.containerMenu.clicked(packetplayinwindowclick.getSlotNum(), packetplayinwindowclick.getButtonNum(), packetplayinwindowclick.getClickType(), this.player);
|
- this.player.containerMenu.clicked(i, packetplayinwindowclick.getButtonNum(), packetplayinwindowclick.getClickType(), this.player);
|
||||||
+ // CraftBukkit start - Call InventoryClickEvent
|
+ // CraftBukkit start - Call InventoryClickEvent
|
||||||
+ if (packetplayinwindowclick.getSlotNum() < -1 && packetplayinwindowclick.getSlotNum() != -999) {
|
+ if (packetplayinwindowclick.getSlotNum() < -1 && packetplayinwindowclick.getSlotNum() != -999) {
|
||||||
+ return;
|
+ return;
|
||||||
@ -1480,7 +1469,7 @@
|
|||||||
+ switch (event.getResult()) {
|
+ switch (event.getResult()) {
|
||||||
+ case ALLOW:
|
+ case ALLOW:
|
||||||
+ case DEFAULT:
|
+ case DEFAULT:
|
||||||
+ this.player.containerMenu.clicked(packetplayinwindowclick.getSlotNum(), packetplayinwindowclick.getButtonNum(), packetplayinwindowclick.getClickType(), this.player);
|
+ this.player.containerMenu.clicked(i, packetplayinwindowclick.getButtonNum(), packetplayinwindowclick.getClickType(), this.player);
|
||||||
+ break;
|
+ break;
|
||||||
+ case DENY:
|
+ case DENY:
|
||||||
+ /* Needs enum constructor in InventoryAction
|
+ /* Needs enum constructor in InventoryAction
|
||||||
@ -1542,15 +1531,15 @@
|
|||||||
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator();
|
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator();
|
||||||
|
|
||||||
while (objectiterator.hasNext()) {
|
while (objectiterator.hasNext()) {
|
||||||
@@ -1456,6 +2480,7 @@
|
@@ -1484,6 +2501,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) {
|
public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.getLevel());
|
||||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
if (this.player.containerMenu.containerId == packetplayinenchantitem.getContainerId() && !this.player.isSpectator()) {
|
if (this.player.containerMenu.containerId == packetplayinenchantitem.getContainerId() && !this.player.isSpectator()) {
|
||||||
this.player.containerMenu.clickMenuButton(this.player, packetplayinenchantitem.getButtonId());
|
boolean flag = this.player.containerMenu.clickMenuButton(this.player, packetplayinenchantitem.getButtonId());
|
||||||
@@ -1483,6 +2508,43 @@
|
@@ -1514,6 +2532,43 @@
|
||||||
|
|
||||||
boolean flag1 = packetplayinsetcreativeslot.getSlotNum() >= 1 && packetplayinsetcreativeslot.getSlotNum() <= 45;
|
boolean flag1 = packetplayinsetcreativeslot.getSlotNum() >= 1 && packetplayinsetcreativeslot.getSlotNum() <= 45;
|
||||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||||
@ -1594,7 +1583,7 @@
|
|||||||
|
|
||||||
if (flag1 && flag2) {
|
if (flag1 && flag2) {
|
||||||
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.getSlotNum()).set(itemstack);
|
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.getSlotNum()).set(itemstack);
|
||||||
@@ -1505,6 +2567,7 @@
|
@@ -1536,6 +2591,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<ITextFilter.a> list) {
|
private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<ITextFilter.a> list) {
|
||||||
@ -1602,7 +1591,7 @@
|
|||||||
this.player.resetLastActionTime();
|
this.player.resetLastActionTime();
|
||||||
WorldServer worldserver = this.player.getLevel();
|
WorldServer worldserver = this.player.getLevel();
|
||||||
BlockPosition blockposition = packetplayinupdatesign.getPos();
|
BlockPosition blockposition = packetplayinupdatesign.getPos();
|
||||||
@@ -1521,18 +2584,37 @@
|
@@ -1552,18 +2608,37 @@
|
||||||
|
|
||||||
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
|
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
|
||||||
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
|
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
|
||||||
@ -1626,8 +1615,8 @@
|
|||||||
} else {
|
} else {
|
||||||
- tileentitysign.setMessage(i, new ChatComponentText(itextfilter_a.getRaw()), new ChatComponentText(itextfilter_a.getFiltered()));
|
- tileentitysign.setMessage(i, new ChatComponentText(itextfilter_a.getRaw()), new ChatComponentText(itextfilter_a.getFiltered()));
|
||||||
+ lines[i] = EnumChatFormat.stripFormatting(new ChatComponentText(EnumChatFormat.stripFormatting(itextfilter_a.getRaw())).getString());
|
+ lines[i] = EnumChatFormat.stripFormatting(new ChatComponentText(EnumChatFormat.stripFormatting(itextfilter_a.getRaw())).getString());
|
||||||
+ }
|
}
|
||||||
+ }
|
}
|
||||||
+ SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
|
+ SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
|
||||||
+ this.cserver.getPluginManager().callEvent(event);
|
+ this.cserver.getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
@ -1635,14 +1624,14 @@
|
|||||||
+ IChatBaseComponent[] components = org.bukkit.craftbukkit.block.CraftSign.sanitizeLines(event.getLines());
|
+ IChatBaseComponent[] components = org.bukkit.craftbukkit.block.CraftSign.sanitizeLines(event.getLines());
|
||||||
+ for (int i = 0; i < components.length; i++) {
|
+ for (int i = 0; i < components.length; i++) {
|
||||||
+ tileentitysign.setMessage(i, components[i]);
|
+ tileentitysign.setMessage(i, components[i]);
|
||||||
}
|
+ }
|
||||||
+ tileentitysign.isEditable = false;
|
+ tileentitysign.isEditable = false;
|
||||||
}
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
tileentitysign.setChanged();
|
tileentitysign.setChanged();
|
||||||
worldserver.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
worldserver.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||||
@@ -1542,6 +2624,7 @@
|
@@ -1573,6 +2648,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleKeepAlive(PacketPlayInKeepAlive packetplayinkeepalive) {
|
public void handleKeepAlive(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||||
@ -1650,7 +1639,7 @@
|
|||||||
if (this.keepAlivePending && packetplayinkeepalive.getId() == this.keepAliveChallenge) {
|
if (this.keepAlivePending && packetplayinkeepalive.getId() == this.keepAliveChallenge) {
|
||||||
int i = (int) (SystemUtils.getMillis() - this.keepAliveTime);
|
int i = (int) (SystemUtils.getMillis() - this.keepAliveTime);
|
||||||
|
|
||||||
@@ -1556,7 +2639,17 @@
|
@@ -1587,7 +2663,17 @@
|
||||||
@Override
|
@Override
|
||||||
public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) {
|
public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) {
|
||||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.getLevel());
|
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.getLevel());
|
||||||
@ -1669,7 +1658,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1565,8 +2658,50 @@
|
@@ -1596,8 +2682,50 @@
|
||||||
this.player.updateOptions(packetplayinsettings);
|
this.player.updateOptions(packetplayinsettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/players/NameReferencingFileConverter.java
|
--- a/net/minecraft/server/players/NameReferencingFileConverter.java
|
||||||
+++ b/net/minecraft/server/players/NameReferencingFileConverter.java
|
+++ b/net/minecraft/server/players/NameReferencingFileConverter.java
|
||||||
@@ -28,6 +28,11 @@
|
@@ -28,6 +28,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.storage.SavedFile;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.nbt.NBTCompressedStreamTools;
|
+import net.minecraft.nbt.NBTCompressedStreamTools;
|
||||||
@ -11,7 +11,7 @@
|
|||||||
+
|
+
|
||||||
public class NameReferencingFileConverter {
|
public class NameReferencingFileConverter {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -88,7 +93,7 @@
|
@@ -88,7 +93,7 @@
|
||||||
try {
|
try {
|
||||||
gameprofilebanlist.load();
|
gameprofilebanlist.load();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -95,6 +95,26 @@
|
@@ -95,6 +95,26 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import com.google.common.base.Predicate;
|
+import com.google.common.base.Predicate;
|
||||||
@ -73,7 +73,7 @@
|
|||||||
this.server = minecraftserver;
|
this.server = minecraftserver;
|
||||||
this.registryHolder = iregistrycustom_dimension;
|
this.registryHolder = iregistrycustom_dimension;
|
||||||
this.maxPlayers = i;
|
this.maxPlayers = i;
|
||||||
@@ -145,6 +177,12 @@
|
@@ -145,9 +177,15 @@
|
||||||
usercache.add(gameprofile);
|
usercache.add(gameprofile);
|
||||||
NBTTagCompound nbttagcompound = this.load(entityplayer);
|
NBTTagCompound nbttagcompound = this.load(entityplayer);
|
||||||
ResourceKey resourcekey;
|
ResourceKey resourcekey;
|
||||||
@ -85,21 +85,25 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
if (nbttagcompound != null) {
|
if (nbttagcompound != null) {
|
||||||
DataResult dataresult = DimensionManager.parseLegacy(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension")));
|
- DataResult dataresult = DimensionManager.parseLegacy(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension")));
|
||||||
|
+ DataResult<ResourceKey<World>> dataresult = DimensionManager.parseLegacy(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension"))); // CraftBukkit - decompile error
|
||||||
|
Logger logger = PlayerList.LOGGER;
|
||||||
|
|
||||||
|
Objects.requireNonNull(logger);
|
||||||
@@ -174,7 +212,8 @@
|
@@ -174,7 +212,8 @@
|
||||||
s1 = networkmanager.getRemoteAddress().toString();
|
s1 = networkmanager.getRemoteAddress().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ());
|
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", new Object[]{entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ()});
|
||||||
+ // CraftBukkit - Moved message to after join
|
+ // CraftBukkit - Moved message to after join
|
||||||
+ // PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ());
|
+ // PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", new Object[]{entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ()});
|
||||||
WorldData worlddata = worldserver1.getLevelData();
|
WorldData worlddata = worldserver1.getLevelData();
|
||||||
|
|
||||||
entityplayer.loadGameTypes(nbttagcompound);
|
entityplayer.loadGameTypes(nbttagcompound);
|
||||||
@@ -184,6 +223,7 @@
|
@@ -184,6 +223,7 @@
|
||||||
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||||
|
|
||||||
playerconnection.send(new PacketPlayOutLogin(entityplayer.getId(), worlddata.isHardcore(), entityplayer.gameMode.getGameModeForPlayer(), entityplayer.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionType(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), this.viewDistance, this.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat()));
|
playerconnection.send(new PacketPlayOutLogin(entityplayer.getId(), worlddata.isHardcore(), entityplayer.gameMode.getGameModeForPlayer(), entityplayer.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionTypeRegistration(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), this.viewDistance, this.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat()));
|
||||||
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||||
playerconnection.send(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.BRAND, (new PacketDataSerializer(Unpooled.buffer())).writeUtf(this.getServer().getServerModName())));
|
playerconnection.send(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.BRAND, (new PacketDataSerializer(Unpooled.buffer())).writeUtf(this.getServer().getServerModName())));
|
||||||
playerconnection.send(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
playerconnection.send(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||||
@ -451,7 +455,7 @@
|
|||||||
+ if (worldserver1 != null) {
|
+ if (worldserver1 != null) {
|
||||||
+ Optional optional;
|
+ Optional optional;
|
||||||
|
|
||||||
- if (!iblockdata.is((Tag) TagsBlock.BEDS) && !flag3) {
|
- if (!iblockdata.is(TagsBlock.BEDS) && !flag3) {
|
||||||
- f1 = f;
|
- f1 = f;
|
||||||
- } else {
|
- } else {
|
||||||
- Vec3D vec3d1 = Vec3D.atBottomCenterOf(blockposition).subtract(vec3d).normalize();
|
- Vec3D vec3d1 = Vec3D.atBottomCenterOf(blockposition).subtract(vec3d).normalize();
|
||||||
@ -467,7 +471,7 @@
|
|||||||
+ Vec3D vec3d = (Vec3D) optional.get();
|
+ Vec3D vec3d = (Vec3D) optional.get();
|
||||||
+ float f1;
|
+ float f1;
|
||||||
+
|
+
|
||||||
+ if (!iblockdata.is((Tag) TagsBlock.BEDS) && !flag3) {
|
+ if (!iblockdata.is(TagsBlock.BEDS) && !flag3) {
|
||||||
+ f1 = f;
|
+ f1 = f;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ Vec3D vec3d1 = Vec3D.atBottomCenterOf(blockposition).subtract(vec3d).normalize();
|
+ Vec3D vec3d1 = Vec3D.atBottomCenterOf(blockposition).subtract(vec3d).normalize();
|
||||||
@ -511,12 +515,12 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
- while (!worldserver1.noCollision((Entity) entityplayer1) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) {
|
- while (!worldserver1.noCollision((Entity) entityplayer1) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) {
|
||||||
+ while (avoidSuffocation && !worldserver1.noCollision(entityplayer1) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) {
|
+ while (avoidSuffocation && !worldserver1.noCollision((Entity) entityplayer1) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) {
|
||||||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||||
}
|
}
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ WorldData worlddata = worldserver1.getLevelData();
|
+ WorldData worlddata = worldserver1.getLevelData();
|
||||||
+ entityplayer1.connection.send(new PacketPlayOutRespawn(worldserver1.dimensionType(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag));
|
+ entityplayer1.connection.send(new PacketPlayOutRespawn(worldserver1.dimensionTypeRegistration(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag));
|
||||||
+ entityplayer1.spawnIn(worldserver1);
|
+ entityplayer1.spawnIn(worldserver1);
|
||||||
+ entityplayer1.unsetRemoved();
|
+ entityplayer1.unsetRemoved();
|
||||||
+ entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot()));
|
+ entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot()));
|
||||||
@ -524,7 +528,7 @@
|
|||||||
|
|
||||||
- WorldData worlddata = entityplayer1.level.getLevelData();
|
- WorldData worlddata = entityplayer1.level.getLevelData();
|
||||||
-
|
-
|
||||||
- entityplayer1.connection.send(new PacketPlayOutRespawn(entityplayer1.level.dimensionType(), entityplayer1.level.dimension(), BiomeManager.obfuscateSeed(entityplayer1.getLevel().getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), entityplayer1.getLevel().isDebug(), entityplayer1.getLevel().isFlat(), flag));
|
- entityplayer1.connection.send(new PacketPlayOutRespawn(entityplayer1.level.dimensionTypeRegistration(), entityplayer1.level.dimension(), BiomeManager.obfuscateSeed(entityplayer1.getLevel().getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), entityplayer1.getLevel().isDebug(), entityplayer1.getLevel().isFlat(), flag));
|
||||||
- entityplayer1.connection.teleport(entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot());
|
- entityplayer1.connection.teleport(entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot());
|
||||||
+ // entityplayer1.connection.teleport(entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot());
|
+ // entityplayer1.connection.teleport(entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot());
|
||||||
entityplayer1.connection.send(new PacketPlayOutSpawnPosition(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle()));
|
entityplayer1.connection.send(new PacketPlayOutSpawnPosition(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle()));
|
||||||
@ -785,5 +789,5 @@
|
|||||||
}
|
}
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
this.broadcastAll(new PacketPlayOutTags(this.server.getTags().serializeToNetwork(this.registryHolder)));
|
this.broadcastAll(new PacketPlayOutTags(TagNetworkSerialization.serializeTagsToNetwork(this.registryHolder)));
|
||||||
PacketPlayOutRecipeUpdate packetplayoutrecipeupdate = new PacketPlayOutRecipeUpdate(this.server.getRecipeManager().getRecipes());
|
PacketPlayOutRecipeUpdate packetplayoutrecipeupdate = new PacketPlayOutRecipeUpdate(this.server.getRecipeManager().getRecipes());
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/stats/RecipeBookServer.java
|
--- a/net/minecraft/stats/RecipeBookServer.java
|
||||||
+++ b/net/minecraft/stats/RecipeBookServer.java
|
+++ b/net/minecraft/stats/RecipeBookServer.java
|
||||||
@@ -20,6 +20,8 @@
|
@@ -20,6 +20,8 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.item.crafting.IRecipe;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||||
+
|
+
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/util/datafix/DataConverterRegistry.java
|
--- a/net/minecraft/util/datafix/DataConverterRegistry.java
|
||||||
+++ b/net/minecraft/util/datafix/DataConverterRegistry.java
|
+++ b/net/minecraft/util/datafix/DataConverterRegistry.java
|
||||||
@@ -391,6 +391,18 @@
|
@@ -395,6 +395,18 @@
|
||||||
datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
|
datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
|
||||||
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.SAME_NAMESPACED);
|
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.SAME_NAMESPACED);
|
||||||
|
|
||||||
@ -19,30 +19,30 @@
|
|||||||
datafixerbuilder.addFixer(new DataConverterCustomNameEntity(schema47, false));
|
datafixerbuilder.addFixer(new DataConverterCustomNameEntity(schema47, false));
|
||||||
datafixerbuilder.addFixer(new DataConverterCustomNameItem(schema47, false));
|
datafixerbuilder.addFixer(new DataConverterCustomNameItem(schema47, false));
|
||||||
datafixerbuilder.addFixer(new DataConverterCustomNameTile(schema47, false));
|
datafixerbuilder.addFixer(new DataConverterCustomNameTile(schema47, false));
|
||||||
@@ -704,12 +716,14 @@
|
@@ -711,12 +723,14 @@
|
||||||
datafixerbuilder.addFixer(new DataConverterAddChoices(schema130, "Added Glow Squid", DataConverterTypes.ENTITY));
|
datafixerbuilder.addFixer(new DataConverterAddChoices(schema131, "Added Glow Squid", DataConverterTypes.ENTITY));
|
||||||
datafixerbuilder.addFixer(new DataConverterAddChoices(schema130, "Added Glow Item Frame", DataConverterTypes.ENTITY));
|
datafixerbuilder.addFixer(new DataConverterAddChoices(schema131, "Added Glow Item Frame", DataConverterTypes.ENTITY));
|
||||||
Schema schema131 = datafixerbuilder.addSchema(2690, DataConverterRegistry.SAME_NAMESPACED);
|
Schema schema132 = datafixerbuilder.addSchema(2690, DataConverterRegistry.SAME_NAMESPACED);
|
||||||
- ImmutableMap<String, String> immutablemap = ImmutableMap.builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build();
|
- ImmutableMap<String, String> immutablemap = ImmutableMap.builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build();
|
||||||
+ // CraftBukkit - decompile error
|
+ // CraftBukkit - decompile error
|
||||||
+ ImmutableMap<String, String> immutablemap = ImmutableMap.<String, String>builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build();
|
+ ImmutableMap<String, String> immutablemap = ImmutableMap.<String, String>builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build();
|
||||||
|
|
||||||
datafixerbuilder.addFixer(DataConverterItemName.create(schema131, "Renamed copper block items to new oxidized terms", createRenamer(immutablemap)));
|
datafixerbuilder.addFixer(DataConverterItemName.create(schema132, "Renamed copper block items to new oxidized terms", createRenamer(immutablemap)));
|
||||||
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema131, "Renamed copper blocks to new oxidized terms", createRenamer(immutablemap)));
|
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema132, "Renamed copper blocks to new oxidized terms", createRenamer(immutablemap)));
|
||||||
Schema schema132 = datafixerbuilder.addSchema(2691, DataConverterRegistry.SAME_NAMESPACED);
|
Schema schema133 = datafixerbuilder.addSchema(2691, DataConverterRegistry.SAME_NAMESPACED);
|
||||||
- ImmutableMap<String, String> immutablemap1 = ImmutableMap.builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build();
|
- ImmutableMap<String, String> immutablemap1 = ImmutableMap.builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build();
|
||||||
+ // CraftBukkit - decompile error
|
+ // CraftBukkit - decompile error
|
||||||
+ ImmutableMap<String, String> immutablemap1 = ImmutableMap.<String, String>builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build();
|
+ ImmutableMap<String, String> immutablemap1 = ImmutableMap.<String, String>builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build();
|
||||||
|
|
||||||
datafixerbuilder.addFixer(DataConverterItemName.create(schema132, "Rename copper item suffixes", createRenamer(immutablemap1)));
|
datafixerbuilder.addFixer(DataConverterItemName.create(schema133, "Rename copper item suffixes", createRenamer(immutablemap1)));
|
||||||
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema132, "Rename copper blocks suffixes", createRenamer(immutablemap1)));
|
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema133, "Rename copper blocks suffixes", createRenamer(immutablemap1)));
|
||||||
@@ -717,7 +731,8 @@
|
@@ -724,7 +738,8 @@
|
||||||
|
|
||||||
datafixerbuilder.addFixer(new AddFlagIfNotPresentFix(schema133, DataConverterTypes.WORLD_GEN_SETTINGS, "has_increased_height_already", false));
|
datafixerbuilder.addFixer(new AddFlagIfNotPresentFix(schema134, DataConverterTypes.WORLD_GEN_SETTINGS, "has_increased_height_already", false));
|
||||||
Schema schema134 = datafixerbuilder.addSchema(2696, DataConverterRegistry.SAME_NAMESPACED);
|
Schema schema135 = datafixerbuilder.addSchema(2696, DataConverterRegistry.SAME_NAMESPACED);
|
||||||
- ImmutableMap<String, String> immutablemap2 = ImmutableMap.builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build();
|
- ImmutableMap<String, String> immutablemap2 = ImmutableMap.builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build();
|
||||||
+ // CraftBukkit - decompile error
|
+ // CraftBukkit - decompile error
|
||||||
+ ImmutableMap<String, String> immutablemap2 = ImmutableMap.<String, String>builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build();
|
+ ImmutableMap<String, String> immutablemap2 = ImmutableMap.<String, String>builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build();
|
||||||
|
|
||||||
datafixerbuilder.addFixer(DataConverterItemName.create(schema134, "Renamed grimstone block items to deepslate", createRenamer(immutablemap2)));
|
datafixerbuilder.addFixer(DataConverterItemName.create(schema135, "Renamed grimstone block items to deepslate", createRenamer(immutablemap2)));
|
||||||
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema134, "Renamed grimstone blocks to deepslate", createRenamer(immutablemap2)));
|
datafixerbuilder.addFixer(BlockRenameFixWithJigsaw.create(schema135, "Renamed grimstone blocks to deepslate", createRenamer(immutablemap2)));
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
@@ -38,6 +38,10 @@
|
@@ -38,6 +38,10 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.storage.WorldPersistentData;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||||
@ -10,7 +10,7 @@
|
|||||||
+
|
+
|
||||||
public class WorldUpgrader {
|
public class WorldUpgrader {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -53,7 +57,7 @@
|
@@ -53,7 +57,7 @@
|
||||||
private volatile int totalChunks;
|
private volatile int totalChunks;
|
||||||
private volatile int converted;
|
private volatile int converted;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -116,8 +116,64 @@
|
@@ -119,8 +119,64 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||||
@ -62,10 +62,10 @@
|
|||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
protected static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
public static final String ID_TAG = "id";
|
public static final String ID_TAG = "id";
|
||||||
public static final String PASSENGERS_TAG = "Passengers";
|
public static final String PASSENGERS_TAG = "Passengers";
|
||||||
@@ -228,6 +284,24 @@
|
@@ -231,6 +287,24 @@
|
||||||
public boolean hasVisualFire;
|
public boolean hasVisualFire;
|
||||||
@Nullable
|
@Nullable
|
||||||
private IBlockData feetBlockState;
|
private IBlockData feetBlockState;
|
||||||
@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
public Entity(EntityTypes<?> entitytypes, World world) {
|
public Entity(EntityTypes<?> entitytypes, World world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
@@ -365,6 +439,12 @@
|
@@ -369,6 +443,12 @@
|
||||||
public void onClientRemoval() {}
|
public void onClientRemoval() {}
|
||||||
|
|
||||||
public void setPose(EntityPose entitypose) {
|
public void setPose(EntityPose entitypose) {
|
||||||
@ -103,7 +103,7 @@
|
|||||||
this.entityData.set(Entity.DATA_POSE, entitypose);
|
this.entityData.set(Entity.DATA_POSE, entitypose);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,6 +461,33 @@
|
@@ -385,6 +465,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setRot(float f, float f1) {
|
protected void setRot(float f, float f1) {
|
||||||
@ -137,7 +137,7 @@
|
|||||||
this.setYRot(f % 360.0F);
|
this.setYRot(f % 360.0F);
|
||||||
this.setXRot(f1 % 360.0F);
|
this.setXRot(f1 % 360.0F);
|
||||||
}
|
}
|
||||||
@@ -422,6 +529,15 @@
|
@@ -426,6 +533,15 @@
|
||||||
this.baseTick();
|
this.baseTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@
|
|||||||
public void baseTick() {
|
public void baseTick() {
|
||||||
this.level.getProfiler().push("entityBaseTick");
|
this.level.getProfiler().push("entityBaseTick");
|
||||||
this.feetBlockState = null;
|
this.feetBlockState = null;
|
||||||
@@ -436,7 +552,7 @@
|
@@ -440,7 +556,7 @@
|
||||||
this.walkDistO = this.walkDist;
|
this.walkDistO = this.walkDist;
|
||||||
this.xRotO = this.getXRot();
|
this.xRotO = this.getXRot();
|
||||||
this.yRotO = this.getYRot();
|
this.yRotO = this.getYRot();
|
||||||
@ -162,7 +162,7 @@
|
|||||||
if (this.canSpawnSprintParticle()) {
|
if (this.canSpawnSprintParticle()) {
|
||||||
this.spawnSprintParticle();
|
this.spawnSprintParticle();
|
||||||
}
|
}
|
||||||
@@ -471,6 +587,10 @@
|
@@ -475,6 +591,10 @@
|
||||||
if (this.isInLava()) {
|
if (this.isInLava()) {
|
||||||
this.lavaHurt();
|
this.lavaHurt();
|
||||||
this.fallDistance *= 0.5F;
|
this.fallDistance *= 0.5F;
|
||||||
@ -173,7 +173,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.checkOutOfWorld();
|
this.checkOutOfWorld();
|
||||||
@@ -514,15 +634,48 @@
|
@@ -518,15 +638,48 @@
|
||||||
|
|
||||||
public void lavaHurt() {
|
public void lavaHurt() {
|
||||||
if (!this.fireImmune()) {
|
if (!this.fireImmune()) {
|
||||||
@ -223,7 +223,7 @@
|
|||||||
int j = i * 20;
|
int j = i * 20;
|
||||||
|
|
||||||
if (this instanceof EntityLiving) {
|
if (this instanceof EntityLiving) {
|
||||||
@@ -627,6 +780,28 @@
|
@@ -640,6 +793,28 @@
|
||||||
block.updateEntityAfterFallOn(this.level, this);
|
block.updateEntityAfterFallOn(this.level, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@
|
|||||||
if (this.onGround && !this.isSteppingCarefully()) {
|
if (this.onGround && !this.isSteppingCarefully()) {
|
||||||
block.stepOn(this.level, blockposition, iblockdata, this);
|
block.stepOn(this.level, blockposition, iblockdata, this);
|
||||||
}
|
}
|
||||||
@@ -1260,6 +1435,7 @@
|
@@ -1265,6 +1440,7 @@
|
||||||
this.yo = d1;
|
this.yo = d1;
|
||||||
this.zo = d4;
|
this.zo = d4;
|
||||||
this.setPos(d3, d1, d4);
|
this.setPos(d3, d1, d4);
|
||||||
@ -260,7 +260,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void moveTo(Vec3D vec3d) {
|
public void moveTo(Vec3D vec3d) {
|
||||||
@@ -1450,6 +1626,12 @@
|
@@ -1455,6 +1631,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +273,7 @@
|
|||||||
public void awardKillScore(Entity entity, int i, DamageSource damagesource) {
|
public void awardKillScore(Entity entity, int i, DamageSource damagesource) {
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
CriterionTriggers.ENTITY_KILLED_PLAYER.trigger((EntityPlayer) entity, this, damagesource);
|
CriterionTriggers.ENTITY_KILLED_PLAYER.trigger((EntityPlayer) entity, this, damagesource);
|
||||||
@@ -1483,7 +1665,7 @@
|
@@ -1488,7 +1670,7 @@
|
||||||
} else {
|
} else {
|
||||||
String s = this.getEncodeId();
|
String s = this.getEncodeId();
|
||||||
|
|
||||||
@ -282,7 +282,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
nbttagcompound.putString("id", s);
|
nbttagcompound.putString("id", s);
|
||||||
@@ -1508,6 +1690,18 @@
|
@@ -1513,6 +1695,18 @@
|
||||||
Vec3D vec3d = this.getDeltaMovement();
|
Vec3D vec3d = this.getDeltaMovement();
|
||||||
|
|
||||||
nbttagcompound.put("Motion", this.newDoubleList(vec3d.x, vec3d.y, vec3d.z));
|
nbttagcompound.put("Motion", this.newDoubleList(vec3d.x, vec3d.y, vec3d.z));
|
||||||
@ -301,7 +301,7 @@
|
|||||||
nbttagcompound.put("Rotation", this.newFloatList(this.getYRot(), this.getXRot()));
|
nbttagcompound.put("Rotation", this.newFloatList(this.getYRot(), this.getXRot()));
|
||||||
nbttagcompound.putFloat("FallDistance", this.fallDistance);
|
nbttagcompound.putFloat("FallDistance", this.fallDistance);
|
||||||
nbttagcompound.putShort("Fire", (short) this.remainingFireTicks);
|
nbttagcompound.putShort("Fire", (short) this.remainingFireTicks);
|
||||||
@@ -1516,6 +1710,22 @@
|
@@ -1521,6 +1715,22 @@
|
||||||
nbttagcompound.putBoolean("Invulnerable", this.invulnerable);
|
nbttagcompound.putBoolean("Invulnerable", this.invulnerable);
|
||||||
nbttagcompound.putInt("PortalCooldown", this.portalCooldown);
|
nbttagcompound.putInt("PortalCooldown", this.portalCooldown);
|
||||||
nbttagcompound.putUUID("UUID", this.getUUID());
|
nbttagcompound.putUUID("UUID", this.getUUID());
|
||||||
@ -324,7 +324,7 @@
|
|||||||
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
||||||
|
|
||||||
if (ichatbasecomponent != null) {
|
if (ichatbasecomponent != null) {
|
||||||
@@ -1583,6 +1793,11 @@
|
@@ -1588,6 +1798,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +336,7 @@
|
|||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||||
@@ -1664,6 +1879,53 @@
|
@@ -1669,6 +1884,53 @@
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("Entity has invalid position");
|
throw new IllegalStateException("Entity has invalid position");
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
|
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
|
||||||
@@ -1739,9 +2001,22 @@
|
@@ -1744,9 +2006,22 @@
|
||||||
} else if (this.level.isClientSide) {
|
} else if (this.level.isClientSide) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@ -413,7 +413,7 @@
|
|||||||
this.level.addFreshEntity(entityitem);
|
this.level.addFreshEntity(entityitem);
|
||||||
return entityitem;
|
return entityitem;
|
||||||
}
|
}
|
||||||
@@ -1836,7 +2111,7 @@
|
@@ -1840,7 +2115,7 @@
|
||||||
|
|
||||||
this.setPose(EntityPose.STANDING);
|
this.setPose(EntityPose.STANDING);
|
||||||
this.vehicle = entity;
|
this.vehicle = entity;
|
||||||
@ -422,7 +422,7 @@
|
|||||||
entity.getIndirectPassengersStream().filter((entity2) -> {
|
entity.getIndirectPassengersStream().filter((entity2) -> {
|
||||||
return entity2 instanceof EntityPlayer;
|
return entity2 instanceof EntityPlayer;
|
||||||
}).forEach((entity2) -> {
|
}).forEach((entity2) -> {
|
||||||
@@ -1867,7 +2142,7 @@
|
@@ -1871,7 +2146,7 @@
|
||||||
Entity entity = this.vehicle;
|
Entity entity = this.vehicle;
|
||||||
|
|
||||||
this.vehicle = null;
|
this.vehicle = null;
|
||||||
@ -431,7 +431,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1876,10 +2151,31 @@
|
@@ -1880,10 +2155,31 @@
|
||||||
this.removeVehicle();
|
this.removeVehicle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +464,7 @@
|
|||||||
if (this.passengers.isEmpty()) {
|
if (this.passengers.isEmpty()) {
|
||||||
this.passengers = ImmutableList.of(entity);
|
this.passengers = ImmutableList.of(entity);
|
||||||
} else {
|
} else {
|
||||||
@@ -1895,12 +2191,32 @@
|
@@ -1899,12 +2195,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -498,7 +498,7 @@
|
|||||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||||
this.passengers = ImmutableList.of();
|
this.passengers = ImmutableList.of();
|
||||||
} else {
|
} else {
|
||||||
@@ -1911,6 +2227,7 @@
|
@@ -1915,6 +2231,7 @@
|
||||||
|
|
||||||
entity.boardingCooldown = 60;
|
entity.boardingCooldown = 60;
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canAddPassenger(Entity entity) {
|
protected boolean canAddPassenger(Entity entity) {
|
||||||
@@ -1961,14 +2278,20 @@
|
@@ -1977,14 +2294,20 @@
|
||||||
|
|
||||||
if (this.isInsidePortal) {
|
if (this.isInsidePortal) {
|
||||||
MinecraftServer minecraftserver = worldserver.getServer();
|
MinecraftServer minecraftserver = worldserver.getServer();
|
||||||
@ -530,7 +530,7 @@
|
|||||||
this.level.getProfiler().pop();
|
this.level.getProfiler().pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2086,6 +2409,13 @@
|
@@ -2102,6 +2425,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSwimming(boolean flag) {
|
public void setSwimming(boolean flag) {
|
||||||
@ -544,7 +544,7 @@
|
|||||||
this.setSharedFlag(4, flag);
|
this.setSharedFlag(4, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2134,8 +2464,12 @@
|
@@ -2150,8 +2480,12 @@
|
||||||
return this.getTeam() != null ? this.getTeam().isAlliedTo(scoreboardteambase) : false;
|
return this.getTeam() != null ? this.getTeam().isAlliedTo(scoreboardteambase) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,7 +558,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean getSharedFlag(int i) {
|
public boolean getSharedFlag(int i) {
|
||||||
@@ -2154,7 +2488,7 @@
|
@@ -2170,7 +2504,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxAirSupply() {
|
public int getMaxAirSupply() {
|
||||||
@ -567,7 +567,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getAirSupply() {
|
public int getAirSupply() {
|
||||||
@@ -2162,7 +2496,18 @@
|
@@ -2178,7 +2512,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAirSupply(int i) {
|
public void setAirSupply(int i) {
|
||||||
@ -587,7 +587,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getTicksFrozen() {
|
public int getTicksFrozen() {
|
||||||
@@ -2189,11 +2534,41 @@
|
@@ -2205,11 +2550,41 @@
|
||||||
|
|
||||||
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
||||||
this.setRemainingFireTicks(this.remainingFireTicks + 1);
|
this.setRemainingFireTicks(this.remainingFireTicks + 1);
|
||||||
@ -631,7 +631,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onAboveBubbleCol(boolean flag) {
|
public void onAboveBubbleCol(boolean flag) {
|
||||||
@@ -2349,15 +2724,38 @@
|
@@ -2365,15 +2740,38 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Entity changeDimension(WorldServer worldserver) {
|
public Entity changeDimension(WorldServer worldserver) {
|
||||||
@ -672,7 +672,7 @@
|
|||||||
this.level.getProfiler().popPush("reloading");
|
this.level.getProfiler().popPush("reloading");
|
||||||
Entity entity = this.getType().create(worldserver);
|
Entity entity = this.getType().create(worldserver);
|
||||||
|
|
||||||
@@ -2366,9 +2764,17 @@
|
@@ -2382,9 +2780,17 @@
|
||||||
entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot());
|
entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot());
|
||||||
entity.setDeltaMovement(shapedetectorshape.speed);
|
entity.setDeltaMovement(shapedetectorshape.speed);
|
||||||
worldserver.addDuringTeleport(entity);
|
worldserver.addDuringTeleport(entity);
|
||||||
@ -692,7 +692,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.removeAfterChangingDimensions();
|
this.removeAfterChangingDimensions();
|
||||||
@@ -2389,20 +2795,34 @@
|
@@ -2405,20 +2811,34 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected ShapeDetectorShape findDimensionEntryPoint(WorldServer worldserver) {
|
protected ShapeDetectorShape findDimensionEntryPoint(WorldServer worldserver) {
|
||||||
@ -732,7 +732,7 @@
|
|||||||
IBlockData iblockdata = this.level.getBlockState(this.portalEntrancePos);
|
IBlockData iblockdata = this.level.getBlockState(this.portalEntrancePos);
|
||||||
EnumDirection.EnumAxis enumdirection_enumaxis;
|
EnumDirection.EnumAxis enumdirection_enumaxis;
|
||||||
Vec3D vec3d;
|
Vec3D vec3d;
|
||||||
@@ -2419,8 +2839,8 @@
|
@@ -2435,8 +2855,8 @@
|
||||||
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
|
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,7 +743,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BlockPosition blockposition1;
|
BlockPosition blockposition1;
|
||||||
@@ -2430,8 +2850,15 @@
|
@@ -2446,8 +2866,15 @@
|
||||||
} else {
|
} else {
|
||||||
blockposition1 = worldserver.getHeightmapPos(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSharedSpawnPos());
|
blockposition1 = worldserver.getHeightmapPos(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSharedSpawnPos());
|
||||||
}
|
}
|
||||||
@ -760,7 +760,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2439,8 +2866,23 @@
|
@@ -2455,8 +2882,23 @@
|
||||||
return BlockPortalShape.getRelativePosition(blockutil_rectangle, enumdirection_enumaxis, this.position(), this.getDimensions(this.getPose()));
|
return BlockPortalShape.getRelativePosition(blockutil_rectangle, enumdirection_enumaxis, this.position(), this.getDimensions(this.getPose()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,7 +786,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canChangeDimensions() {
|
public boolean canChangeDimensions() {
|
||||||
@@ -2649,7 +3091,26 @@
|
@@ -2665,7 +3107,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setBoundingBox(AxisAlignedBB axisalignedbb) {
|
public final void setBoundingBox(AxisAlignedBB axisalignedbb) {
|
||||||
@ -814,12 +814,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected float getEyeHeight(EntityPose entitypose, EntitySize entitysize) {
|
protected float getEyeHeight(EntityPose entitypose, EntitySize entitysize) {
|
||||||
@@ -2933,6 +3394,11 @@
|
@@ -2949,6 +3410,11 @@
|
||||||
vec3d = vec3d.add(vec3d1);
|
vec3d = vec3d.add(vec3d1);
|
||||||
++k1;
|
++k1;
|
||||||
}
|
}
|
||||||
+ // CraftBukkit start - store last lava contact location
|
+ // CraftBukkit start - store last lava contact location
|
||||||
+ if (tag == TagsFluid.LAVA) {
|
+ if (tagkey == TagsFluid.LAVA) {
|
||||||
+ this.lastLavaContact = blockposition_mutableblockposition.immutable();
|
+ this.lastLavaContact = blockposition_mutableblockposition.immutable();
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
--- a/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
||||||
+++ b/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
+++ b/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
||||||
@@ -32,6 +32,12 @@
|
@@ -32,6 +32,12 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.material.EnumPistonReaction;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.resources.MinecraftKey;
|
+import net.minecraft.resources.MinecraftKey;
|
||||||
@ -12,7 +12,7 @@
|
|||||||
+
|
+
|
||||||
public class EntityAreaEffectCloud extends Entity {
|
public class EntityAreaEffectCloud extends Entity {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -127,6 +133,22 @@
|
@@ -127,6 +133,22 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/EntityExperienceOrb.java
|
--- a/net/minecraft/world/entity/EntityExperienceOrb.java
|
||||||
+++ b/net/minecraft/world/entity/EntityExperienceOrb.java
|
+++ b/net/minecraft/world/entity/EntityExperienceOrb.java
|
||||||
@@ -21,6 +21,12 @@
|
@@ -20,6 +20,12 @@
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
public class EntityExperienceOrb extends Entity {
|
public class EntityExperienceOrb extends Entity {
|
||||||
|
|
||||||
private static final int LIFETIME = 6000;
|
private static final int LIFETIME = 6000;
|
||||||
@@ -59,6 +65,7 @@
|
@@ -58,6 +64,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
@ -21,7 +21,7 @@
|
|||||||
this.xo = this.getX();
|
this.xo = this.getX();
|
||||||
this.yo = this.getY();
|
this.yo = this.getY();
|
||||||
this.zo = this.getZ();
|
this.zo = this.getZ();
|
||||||
@@ -84,7 +91,22 @@
|
@@ -83,7 +90,22 @@
|
||||||
this.followingPlayer = null;
|
this.followingPlayer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@
|
|||||||
Vec3D vec3d = new Vec3D(this.followingPlayer.getX() - this.getX(), this.followingPlayer.getY() + (double) this.followingPlayer.getEyeHeight() / 2.0D - this.getY(), this.followingPlayer.getZ() - this.getZ());
|
Vec3D vec3d = new Vec3D(this.followingPlayer.getX() - this.getX(), this.followingPlayer.getY() + (double) this.followingPlayer.getEyeHeight() / 2.0D - this.getY(), this.followingPlayer.getZ() - this.getZ());
|
||||||
double d0 = vec3d.lengthSqr();
|
double d0 = vec3d.lengthSqr();
|
||||||
|
|
||||||
@@ -225,7 +247,7 @@
|
@@ -226,7 +248,7 @@
|
||||||
int i = this.repairPlayerItems(entityhuman, this.value);
|
int i = this.repairPlayerItems(entityhuman, this.value);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -54,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
--this.count;
|
--this.count;
|
||||||
@@ -243,9 +265,17 @@
|
@@ -244,9 +266,17 @@
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
ItemStack itemstack = (ItemStack) entry.getValue();
|
ItemStack itemstack = (ItemStack) entry.getValue();
|
||||||
int j = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue());
|
int j = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue());
|
||||||
@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
return k > 0 ? this.repairPlayerItems(entityhuman, k) : 0;
|
return k > 0 ? this.repairPlayerItems(entityhuman, k) : 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -270,6 +300,24 @@
|
@@ -271,6 +301,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getExperienceValue(int i) {
|
public static int getExperienceValue(int i) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/EntityLiving.java
|
--- a/net/minecraft/world/entity/EntityLiving.java
|
||||||
+++ b/net/minecraft/world/entity/EntityLiving.java
|
+++ b/net/minecraft/world/entity/EntityLiving.java
|
||||||
@@ -116,6 +116,30 @@
|
@@ -117,6 +117,30 @@
|
||||||
import net.minecraft.world.scores.ScoreboardTeam;
|
import net.minecraft.world.scores.ScoreboardTeam;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
@ -30,8 +30,8 @@
|
|||||||
+
|
+
|
||||||
public abstract class EntityLiving extends Entity {
|
public abstract class EntityLiving extends Entity {
|
||||||
|
|
||||||
private static final UUID SPEED_MODIFIER_SPRINTING_UUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -224,6 +248,20 @@
|
@@ -226,6 +250,20 @@
|
||||||
private float swimAmount;
|
private float swimAmount;
|
||||||
private float swimAmountO;
|
private float swimAmountO;
|
||||||
protected BehaviorController<?> brain;
|
protected BehaviorController<?> brain;
|
||||||
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
protected EntityLiving(EntityTypes<? extends EntityLiving> entitytypes, World world) {
|
protected EntityLiving(EntityTypes<? extends EntityLiving> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -236,7 +274,9 @@
|
@@ -238,7 +276,9 @@
|
||||||
this.useItem = ItemStack.EMPTY;
|
this.useItem = ItemStack.EMPTY;
|
||||||
this.lastClimbablePos = Optional.empty();
|
this.lastClimbablePos = Optional.empty();
|
||||||
this.attributes = new AttributeMapBase(AttributeDefaults.getSupplier(entitytypes));
|
this.attributes = new AttributeMapBase(AttributeDefaults.getSupplier(entitytypes));
|
||||||
@ -63,7 +63,7 @@
|
|||||||
this.blocksBuilding = true;
|
this.blocksBuilding = true;
|
||||||
this.rotA = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
this.rotA = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
||||||
this.reapplyPosition();
|
this.reapplyPosition();
|
||||||
@@ -303,7 +343,13 @@
|
@@ -305,7 +345,13 @@
|
||||||
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||||
int i = (int) (150.0D * d1);
|
int i = (int) (150.0D * d1);
|
||||||
|
|
||||||
@ -78,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +607,7 @@
|
@@ -563,7 +609,7 @@
|
||||||
|
|
||||||
protected void tickDeath() {
|
protected void tickDeath() {
|
||||||
++this.deathTime;
|
++this.deathTime;
|
||||||
@ -87,7 +87,7 @@
|
|||||||
this.level.broadcastEntityEvent(this, (byte) 60);
|
this.level.broadcastEntityEvent(this, (byte) 60);
|
||||||
this.remove(Entity.RemovalReason.KILLED);
|
this.remove(Entity.RemovalReason.KILLED);
|
||||||
}
|
}
|
||||||
@@ -653,9 +699,15 @@
|
@@ -655,9 +701,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void equipEventAndSound(ItemStack itemstack) {
|
protected void equipEventAndSound(ItemStack itemstack) {
|
||||||
@ -104,7 +104,7 @@
|
|||||||
this.gameEvent(GameEvent.EQUIP);
|
this.gameEvent(GameEvent.EQUIP);
|
||||||
this.playSound(soundeffect, 1.0F, 1.0F);
|
this.playSound(soundeffect, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
@@ -717,6 +769,17 @@
|
@@ -719,6 +771,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@
|
|||||||
if (nbttagcompound.contains("Health", 99)) {
|
if (nbttagcompound.contains("Health", 99)) {
|
||||||
this.setHealth(nbttagcompound.getFloat("Health"));
|
this.setHealth(nbttagcompound.getFloat("Health"));
|
||||||
}
|
}
|
||||||
@@ -754,9 +817,32 @@
|
@@ -756,9 +819,32 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@
|
|||||||
try {
|
try {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
||||||
@@ -766,6 +852,12 @@
|
@@ -768,6 +854,12 @@
|
||||||
this.onEffectUpdated(mobeffect, true, (Entity) null);
|
this.onEffectUpdated(mobeffect, true, (Entity) null);
|
||||||
})) {
|
})) {
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -168,7 +168,7 @@
|
|||||||
iterator.remove();
|
iterator.remove();
|
||||||
this.onEffectRemoved(mobeffect);
|
this.onEffectRemoved(mobeffect);
|
||||||
}
|
}
|
||||||
@@ -776,6 +868,17 @@
|
@@ -778,6 +870,17 @@
|
||||||
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
if (this.effectsDirty) {
|
if (this.effectsDirty) {
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@@ -902,7 +1005,13 @@
|
@@ -904,7 +1007,13 @@
|
||||||
this.entityData.set(EntityLiving.DATA_EFFECT_COLOR_ID, 0);
|
this.entityData.set(EntityLiving.DATA_EFFECT_COLOR_ID, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@
|
|||||||
if (this.level.isClientSide) {
|
if (this.level.isClientSide) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@@ -911,7 +1020,14 @@
|
@@ -913,7 +1022,14 @@
|
||||||
boolean flag;
|
boolean flag;
|
||||||
|
|
||||||
for (flag = false; iterator.hasNext(); flag = true) {
|
for (flag = false; iterator.hasNext(); flag = true) {
|
||||||
@ -216,7 +216,7 @@
|
|||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -940,18 +1056,48 @@
|
@@ -942,18 +1058,48 @@
|
||||||
return this.addEffect(mobeffect, (Entity) null);
|
return this.addEffect(mobeffect, (Entity) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +266,7 @@
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -988,13 +1134,39 @@
|
@@ -990,13 +1136,39 @@
|
||||||
return this.getMobType() == EnumMonsterType.UNDEAD;
|
return this.getMobType() == EnumMonsterType.UNDEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +307,7 @@
|
|||||||
|
|
||||||
if (mobeffect != null) {
|
if (mobeffect != null) {
|
||||||
this.onEffectRemoved(mobeffect);
|
this.onEffectRemoved(mobeffect);
|
||||||
@@ -1031,20 +1203,55 @@
|
@@ -1033,20 +1205,55 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@
|
|||||||
this.entityData.set(EntityLiving.DATA_HEALTH_ID, MathHelper.clamp(f, 0.0F, this.getMaxHealth()));
|
this.entityData.set(EntityLiving.DATA_HEALTH_ID, MathHelper.clamp(f, 0.0F, this.getMaxHealth()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1058,7 +1265,7 @@
|
@@ -1060,7 +1267,7 @@
|
||||||
return false;
|
return false;
|
||||||
} else if (this.level.isClientSide) {
|
} else if (this.level.isClientSide) {
|
||||||
return false;
|
return false;
|
||||||
@ -373,7 +373,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
|
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1069,10 +1276,11 @@
|
@@ -1071,10 +1278,11 @@
|
||||||
|
|
||||||
this.noActionTime = 0;
|
this.noActionTime = 0;
|
||||||
float f1 = f;
|
float f1 = f;
|
||||||
@ -387,7 +387,7 @@
|
|||||||
this.hurtCurrentlyUsedShield(f);
|
this.hurtCurrentlyUsedShield(f);
|
||||||
f2 = f;
|
f2 = f;
|
||||||
f = 0.0F;
|
f = 0.0F;
|
||||||
@@ -1090,27 +1298,46 @@
|
@@ -1092,27 +1300,46 @@
|
||||||
this.animationSpeed = 1.5F;
|
this.animationSpeed = 1.5F;
|
||||||
boolean flag1 = true;
|
boolean flag1 = true;
|
||||||
|
|
||||||
@ -439,7 +439,7 @@
|
|||||||
this.hurtDir = 0.0F;
|
this.hurtDir = 0.0F;
|
||||||
Entity entity1 = damagesource.getEntity();
|
Entity entity1 = damagesource.getEntity();
|
||||||
|
|
||||||
@@ -1233,19 +1460,29 @@
|
@@ -1235,19 +1462,29 @@
|
||||||
EnumHand[] aenumhand = EnumHand.values();
|
EnumHand[] aenumhand = EnumHand.values();
|
||||||
int i = aenumhand.length;
|
int i = aenumhand.length;
|
||||||
|
|
||||||
@ -473,7 +473,7 @@
|
|||||||
EntityPlayer entityplayer = (EntityPlayer) this;
|
EntityPlayer entityplayer = (EntityPlayer) this;
|
||||||
|
|
||||||
entityplayer.awardStat(StatisticList.ITEM_USED.get(Items.TOTEM_OF_UNDYING));
|
entityplayer.awardStat(StatisticList.ITEM_USED.get(Items.TOTEM_OF_UNDYING));
|
||||||
@@ -1253,14 +1490,16 @@
|
@@ -1255,14 +1492,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setHealth(1.0F);
|
this.setHealth(1.0F);
|
||||||
@ -495,7 +495,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1365,14 +1604,22 @@
|
@@ -1367,14 +1606,22 @@
|
||||||
IBlockData iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
IBlockData iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||||
|
|
||||||
if (this.level.getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level, blockposition)) {
|
if (this.level.getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level, blockposition)) {
|
||||||
@ -520,7 +520,7 @@
|
|||||||
this.level.addFreshEntity(entityitem);
|
this.level.addFreshEntity(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1392,21 +1639,40 @@
|
@@ -1394,21 +1641,40 @@
|
||||||
|
|
||||||
boolean flag = this.lastHurtByPlayerTime > 0;
|
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||||
|
|
||||||
@ -564,7 +564,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1526,9 +1792,14 @@
|
@@ -1528,9 +1794,14 @@
|
||||||
int i = this.calculateFallDamage(f, f1);
|
int i = this.calculateFallDamage(f, f1);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -580,7 +580,7 @@
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return flag;
|
return flag;
|
||||||
@@ -1577,7 +1848,7 @@
|
@@ -1579,7 +1850,7 @@
|
||||||
|
|
||||||
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
|
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
|
||||||
if (!damagesource.isBypassArmor()) {
|
if (!damagesource.isBypassArmor()) {
|
||||||
@ -589,7 +589,7 @@
|
|||||||
f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
|
f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1590,7 +1861,8 @@
|
@@ -1592,7 +1863,8 @@
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -599,7 +599,7 @@
|
|||||||
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
||||||
int j = 25 - i;
|
int j = 25 - i;
|
||||||
float f1 = f * (float) j;
|
float f1 = f * (float) j;
|
||||||
@@ -1621,29 +1893,172 @@
|
@@ -1623,29 +1895,172 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,7 +782,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CombatTracker getCombatTracker() {
|
public CombatTracker getCombatTracker() {
|
||||||
@@ -1664,8 +2079,18 @@
|
@@ -1666,8 +2081,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setArrowCount(int i) {
|
public final void setArrowCount(int i) {
|
||||||
@ -802,7 +802,7 @@
|
|||||||
|
|
||||||
public final int getStingerCount() {
|
public final int getStingerCount() {
|
||||||
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
||||||
@@ -1961,6 +2386,12 @@
|
@@ -1963,6 +2388,12 @@
|
||||||
|
|
||||||
public abstract ItemStack getItemBySlot(EnumItemSlot enumitemslot);
|
public abstract ItemStack getItemBySlot(EnumItemSlot enumitemslot);
|
||||||
|
|
||||||
@ -815,7 +815,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public abstract void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
public abstract void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
||||||
|
|
||||||
@@ -2204,6 +2635,7 @@
|
@@ -2206,6 +2637,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround && !this.level.isClientSide) {
|
if (this.onGround && !this.level.isClientSide) {
|
||||||
@ -823,7 +823,7 @@
|
|||||||
this.setSharedFlag(7, false);
|
this.setSharedFlag(7, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2734,6 +3166,7 @@
|
@@ -2736,6 +3168,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -831,7 +831,7 @@
|
|||||||
this.setSharedFlag(7, flag);
|
this.setSharedFlag(7, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2901,14 +3334,21 @@
|
@@ -2895,14 +3328,21 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPickable() {
|
public boolean isPickable() {
|
||||||
@ -853,9 +853,9 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
protected void markHurt() {
|
public float getYHeadRot() {
|
||||||
this.hurtMarked = this.random.nextDouble() >= this.getAttributeValue(GenericAttributes.KNOCKBACK_RESISTANCE);
|
return this.yHeadRot;
|
||||||
@@ -3107,7 +3547,25 @@
|
@@ -3096,7 +3536,25 @@
|
||||||
} else {
|
} else {
|
||||||
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
||||||
this.triggerItemUseEffects(this.useItem, 16);
|
this.triggerItemUseEffects(this.useItem, 16);
|
||||||
@ -882,7 +882,7 @@
|
|||||||
|
|
||||||
if (itemstack != this.useItem) {
|
if (itemstack != this.useItem) {
|
||||||
this.setItemInHand(enumhand, itemstack);
|
this.setItemInHand(enumhand, itemstack);
|
||||||
@@ -3180,6 +3638,12 @@
|
@@ -3169,6 +3627,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean randomTeleport(double d0, double d1, double d2, boolean flag) {
|
public boolean randomTeleport(double d0, double d1, double d2, boolean flag) {
|
||||||
@ -895,7 +895,7 @@
|
|||||||
double d3 = this.getX();
|
double d3 = this.getX();
|
||||||
double d4 = this.getY();
|
double d4 = this.getY();
|
||||||
double d5 = this.getZ();
|
double d5 = this.getZ();
|
||||||
@@ -3204,16 +3668,41 @@
|
@@ -3193,16 +3657,41 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag2) {
|
if (flag2) {
|
||||||
@ -940,7 +940,7 @@
|
|||||||
} else {
|
} else {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
world.broadcastEntityEvent(this, (byte) 46);
|
world.broadcastEntityEvent(this, (byte) 46);
|
||||||
@@ -3223,7 +3712,7 @@
|
@@ -3212,7 +3701,7 @@
|
||||||
((EntityCreature) this).getNavigation().stop();
|
((EntityCreature) this).getNavigation().stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -949,7 +949,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3306,7 +3795,7 @@
|
@@ -3295,7 +3784,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopSleeping() {
|
public void stopSleeping() {
|
||||||
@ -958,7 +958,7 @@
|
|||||||
World world = this.level;
|
World world = this.level;
|
||||||
|
|
||||||
java.util.Objects.requireNonNull(this.level);
|
java.util.Objects.requireNonNull(this.level);
|
||||||
@@ -3338,7 +3827,7 @@
|
@@ -3327,7 +3816,7 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public EnumDirection getBedOrientation() {
|
public EnumDirection getBedOrientation() {
|
||||||
@ -967,7 +967,7 @@
|
|||||||
|
|
||||||
return blockposition != null ? BlockBed.getBedOrientation(this.level, blockposition) : null;
|
return blockposition != null ? BlockBed.getBedOrientation(this.level, blockposition) : null;
|
||||||
}
|
}
|
||||||
@@ -3387,7 +3876,7 @@
|
@@ -3376,7 +3865,7 @@
|
||||||
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
||||||
|
|
||||||
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
||||||
@ -976,7 +976,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3490,8 +3979,10 @@
|
@@ -3479,8 +3968,10 @@
|
||||||
this.setDeltaMovement((double) ((float) packetplayoutspawnentityliving.getXd() / 8000.0F), (double) ((float) packetplayoutspawnentityliving.getYd() / 8000.0F), (double) ((float) packetplayoutspawnentityliving.getZd() / 8000.0F));
|
this.setDeltaMovement((double) ((float) packetplayoutspawnentityliving.getXd() / 8000.0F), (double) ((float) packetplayoutspawnentityliving.getYd() / 8000.0F), (double) ((float) packetplayoutspawnentityliving.getZd() / 8000.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -988,7 +988,7 @@
|
|||||||
private final SoundEffect small;
|
private final SoundEffect small;
|
||||||
private final SoundEffect big;
|
private final SoundEffect big;
|
||||||
|
|
||||||
@@ -3507,5 +3998,7 @@
|
@@ -3496,5 +3987,7 @@
|
||||||
public SoundEffect big() {
|
public SoundEffect big() {
|
||||||
return this.big;
|
return this.big;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
--- a/net/minecraft/world/entity/EntityTypes.java
|
--- a/net/minecraft/world/entity/EntityTypes.java
|
||||||
+++ b/net/minecraft/world/entity/EntityTypes.java
|
+++ b/net/minecraft/world/entity/EntityTypes.java
|
||||||
@@ -152,7 +152,7 @@
|
@@ -154,7 +154,7 @@
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
|
||||||
public static final String ENTITY_TAG = "EntityTag";
|
public static final String ENTITY_TAG = "EntityTag";
|
||||||
|
private final Holder.c<EntityTypes<?>> builtInRegistryHolder;
|
||||||
private static final float MAGIC_HORSE_WIDTH = 1.3964844F;
|
private static final float MAGIC_HORSE_WIDTH = 1.3964844F;
|
||||||
- public static final EntityTypes<EntityAreaEffectCloud> AREA_EFFECT_CLOUD = register("area_effect_cloud", EntityTypes.Builder.of(EntityAreaEffectCloud::new, EnumCreatureType.MISC).fireImmune().sized(6.0F, 0.5F).clientTrackingRange(10).updateInterval(Integer.MAX_VALUE));
|
- public static final EntityTypes<EntityAreaEffectCloud> AREA_EFFECT_CLOUD = register("area_effect_cloud", EntityTypes.Builder.of(EntityAreaEffectCloud::new, EnumCreatureType.MISC).fireImmune().sized(6.0F, 0.5F).clientTrackingRange(10).updateInterval(Integer.MAX_VALUE));
|
||||||
+ public static final EntityTypes<EntityAreaEffectCloud> AREA_EFFECT_CLOUD = register("area_effect_cloud", EntityTypes.Builder.of(EntityAreaEffectCloud::new, EnumCreatureType.MISC).fireImmune().sized(6.0F, 0.5F).clientTrackingRange(10).updateInterval(10)); // CraftBukkit - SPIGOT-3729: track area effect clouds
|
+ public static final EntityTypes<EntityAreaEffectCloud> AREA_EFFECT_CLOUD = register("area_effect_cloud", EntityTypes.Builder.of(EntityAreaEffectCloud::new, EnumCreatureType.MISC).fireImmune().sized(6.0F, 0.5F).clientTrackingRange(10).updateInterval(10)); // CraftBukkit - SPIGOT-3729: track area effect clouds
|
||||||
public static final EntityTypes<EntityArmorStand> ARMOR_STAND = register("armor_stand", EntityTypes.Builder.of(EntityArmorStand::new, EnumCreatureType.MISC).sized(0.5F, 1.975F).clientTrackingRange(10));
|
public static final EntityTypes<EntityArmorStand> ARMOR_STAND = register("armor_stand", EntityTypes.Builder.of(EntityArmorStand::new, EnumCreatureType.MISC).sized(0.5F, 1.975F).clientTrackingRange(10));
|
||||||
public static final EntityTypes<EntityTippedArrow> ARROW = register("arrow", EntityTypes.Builder.of(EntityTippedArrow::new, EnumCreatureType.MISC).sized(0.5F, 0.5F).clientTrackingRange(4).updateInterval(20));
|
public static final EntityTypes<EntityTippedArrow> ARROW = register("arrow", EntityTypes.Builder.of(EntityTippedArrow::new, EnumCreatureType.MISC).sized(0.5F, 0.5F).clientTrackingRange(4).updateInterval(20));
|
||||||
public static final EntityTypes<Axolotl> AXOLOTL = register("axolotl", EntityTypes.Builder.of(Axolotl::new, EnumCreatureType.AXOLOTLS).sized(0.75F, 0.42F).clientTrackingRange(10));
|
public static final EntityTypes<Axolotl> AXOLOTL = register("axolotl", EntityTypes.Builder.of(Axolotl::new, EnumCreatureType.AXOLOTLS).sized(0.75F, 0.42F).clientTrackingRange(10));
|
||||||
@@ -282,8 +282,8 @@
|
@@ -284,8 +284,8 @@
|
||||||
private MinecraftKey lootTable;
|
private MinecraftKey lootTable;
|
||||||
private final EntitySize dimensions;
|
private final EntitySize dimensions;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MinecraftKey getKey(EntityTypes<?> entitytypes) {
|
public static MinecraftKey getKey(EntityTypes<?> entitytypes) {
|
||||||
@@ -314,10 +314,18 @@
|
@@ -317,10 +317,18 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public T spawn(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
public T spawn(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
||||||
@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return t0;
|
return t0;
|
||||||
@@ -353,7 +361,7 @@
|
@@ -356,7 +364,7 @@
|
||||||
t0.setCustomName(ichatbasecomponent);
|
t0.setCustomName(ichatbasecomponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@
|
|||||||
return t0;
|
return t0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -510,7 +518,7 @@
|
@@ -513,7 +521,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return entity;
|
return entity;
|
||||||
@ -58,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<Entity> loadEntitiesRecursive(final List<? extends NBTBase> list, final World world) {
|
public static Stream<Entity> loadEntitiesRecursive(final List<? extends NBTBase> list, final World world) {
|
||||||
@@ -567,7 +575,7 @@
|
@@ -570,7 +578,7 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public T tryCast(Entity entity) {
|
public T tryCast(Entity entity) {
|
||||||
@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -594,7 +602,7 @@
|
@@ -603,7 +611,7 @@
|
||||||
this.canSpawnFarFromPlayer = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
|
this.canSpawnFarFromPlayer = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
--- a/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
||||||
@@ -13,6 +13,12 @@
|
@@ -12,6 +12,12 @@
|
||||||
import net.minecraft.world.entity.npc.EntityVillager;
|
import net.minecraft.world.entity.npc.EntityVillager;
|
||||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
public class BehaviorCareer extends Behavior<EntityVillager> {
|
public class BehaviorCareer extends Behavior<EntityVillager> {
|
||||||
|
|
||||||
public BehaviorCareer() {
|
public BehaviorCareer() {
|
||||||
@@ -29,7 +35,7 @@
|
@@ -28,7 +34,7 @@
|
||||||
GlobalPos globalpos = (GlobalPos) entityvillager.getBrain().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
|
GlobalPos globalpos = (GlobalPos) entityvillager.getBrain().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
|
||||||
|
|
||||||
entityvillager.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
entityvillager.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||||
@ -22,7 +22,7 @@
|
|||||||
worldserver.broadcastEntityEvent(entityvillager, (byte) 14);
|
worldserver.broadcastEntityEvent(entityvillager, (byte) 14);
|
||||||
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
|
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
|
||||||
MinecraftServer minecraftserver = worldserver.getServer();
|
MinecraftServer minecraftserver = worldserver.getServer();
|
||||||
@@ -41,7 +47,14 @@
|
@@ -40,7 +46,14 @@
|
||||||
return villagerprofession.getJobPoiType() == villageplacetype;
|
return villagerprofession.getJobPoiType() == villageplacetype;
|
||||||
}).findFirst();
|
}).findFirst();
|
||||||
}).ifPresent((villagerprofession) -> {
|
}).ifPresent((villagerprofession) -> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
||||||
@@ -80,8 +80,8 @@
|
@@ -79,8 +79,8 @@
|
||||||
|
|
||||||
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
||||||
if (i > this.nextOkStartTime && this.aboveFarmlandPos != null) {
|
if (i > this.nextOkStartTime && this.aboveFarmlandPos != null) {
|
||||||
@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,11 @@
|
@@ -100,7 +100,11 @@
|
||||||
Block block1 = worldserver.getBlockState(this.aboveFarmlandPos.below()).getBlock();
|
Block block1 = worldserver.getBlockState(this.aboveFarmlandPos.below()).getBlock();
|
||||||
|
|
||||||
if (block instanceof BlockCrops && ((BlockCrops) block).isMaxAge(iblockdata)) {
|
if (block instanceof BlockCrops && ((BlockCrops) block).isMaxAge(iblockdata)) {
|
||||||
@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.hasFarmSeeds()) {
|
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.hasFarmSeeds()) {
|
||||||
@@ -112,19 +116,28 @@
|
@@ -111,19 +115,28 @@
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
|
|
||||||
if (!itemstack.isEmpty()) {
|
if (!itemstack.isEmpty()) {
|
||||||
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@@ -143,8 +156,8 @@
|
@@ -142,8 +155,8 @@
|
||||||
this.aboveFarmlandPos = this.getValidFarmland(worldserver);
|
this.aboveFarmlandPos = this.getValidFarmland(worldserver);
|
||||||
if (this.aboveFarmlandPos != null) {
|
if (this.aboveFarmlandPos != null) {
|
||||||
this.nextOkStartTime = i + 20L;
|
this.nextOkStartTime = i + 20L;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
blockdoor.setOpen(entityliving, worldserver, iblockdata, blockposition, true);
|
blockdoor.setOpen(entityliving, worldserver, iblockdata, blockposition, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +89,13 @@
|
@@ -84,6 +91,13 @@
|
||||||
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
|
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
|
||||||
|
|
||||||
if (!blockdoor1.isOpen(iblockdata1)) {
|
if (!blockdoor1.isOpen(iblockdata1)) {
|
||||||
@ -28,7 +28,7 @@
|
|||||||
blockdoor1.setOpen(entityliving, worldserver, iblockdata1, blockposition1, true);
|
blockdoor1.setOpen(entityliving, worldserver, iblockdata1, blockposition1, true);
|
||||||
this.rememberDoorToClose(worldserver, entityliving, blockposition1);
|
this.rememberDoorToClose(worldserver, entityliving, blockposition1);
|
||||||
}
|
}
|
||||||
@@ -130,7 +144,7 @@
|
@@ -134,7 +148,7 @@
|
||||||
private static boolean areOtherMobsComingThroughDoor(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
|
private static boolean areOtherMobsComingThroughDoor(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
|
||||||
BehaviorController<?> behaviorcontroller = entityliving.getBrain();
|
BehaviorController<?> behaviorcontroller = entityliving.getBrain();
|
||||||
|
|
||||||
@ -36,8 +36,8 @@
|
|||||||
+ return !behaviorcontroller.hasMemoryValue(MemoryModuleType.NEAREST_LIVING_ENTITIES) ? false : (behaviorcontroller.getMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES).get()).stream().filter((entityliving1) -> { // CraftBukkit - decompile error
|
+ return !behaviorcontroller.hasMemoryValue(MemoryModuleType.NEAREST_LIVING_ENTITIES) ? false : (behaviorcontroller.getMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES).get()).stream().filter((entityliving1) -> { // CraftBukkit - decompile error
|
||||||
return entityliving1.getType() == entityliving.getType();
|
return entityliving1.getType() == entityliving.getType();
|
||||||
}).filter((entityliving1) -> {
|
}).filter((entityliving1) -> {
|
||||||
return blockposition.closerThan((IPosition) entityliving1.position(), 2.0D);
|
return blockposition.closerToCenterThan(entityliving1.position(), 2.0D);
|
||||||
@@ -172,7 +186,7 @@
|
@@ -176,7 +190,7 @@
|
||||||
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
|
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
|
||||||
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
|
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||||
@@ -72,6 +72,12 @@
|
@@ -71,6 +71,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.breakTime == this.getDoorBreakTime() && this.isValidDifficulty(this.mob.level.getDifficulty())) {
|
if (this.breakTime == this.getDoorBreakTime() && this.isValidDifficulty(this.mob.level.getDifficulty())) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
||||||
@@ -11,6 +11,10 @@
|
@@ -10,6 +10,10 @@
|
||||||
import net.minecraft.world.level.IBlockAccess;
|
import net.minecraft.world.level.IBlockAccess;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
public class PathfinderGoalPanic extends PathfinderGoal {
|
public class PathfinderGoalPanic extends PathfinderGoal {
|
||||||
|
|
||||||
public static final int WATER_CHECK_DISTANCE_VERTICAL = 1;
|
public static final int WATER_CHECK_DISTANCE_VERTICAL = 1;
|
||||||
@@ -77,6 +81,12 @@
|
@@ -80,6 +84,12 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canContinueToUse() {
|
public boolean canContinueToUse() {
|
||||||
@ -24,10 +24,10 @@
|
|||||||
return !this.mob.getNavigation().isDone();
|
return !this.mob.getNavigation().isDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +96,6 @@
|
@@ -89,6 +99,6 @@
|
||||||
|
|
||||||
return !iblockaccess.getBlockState(blockposition).getCollisionShape(iblockaccess, blockposition).isEmpty() ? null : (BlockPosition) BlockPosition.findClosestMatch(entity.blockPosition(), i, 1, (blockposition1) -> {
|
return !iblockaccess.getBlockState(blockposition).getCollisionShape(iblockaccess, blockposition).isEmpty() ? null : (BlockPosition) BlockPosition.findClosestMatch(entity.blockPosition(), i, 1, (blockposition1) -> {
|
||||||
return iblockaccess.getFluidState(blockposition1).is((Tag) TagsFluid.WATER);
|
return iblockaccess.getFluidState(blockposition1).is(TagsFluid.WATER);
|
||||||
- }).orElse((Object) null);
|
- }).orElse((Object) null);
|
||||||
+ }).orElse(null); // CraftBukkit - decompile error
|
+ }).orElse(null); // CraftBukkit - decompile error
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/ambient/EntityBat.java
|
--- a/net/minecraft/world/entity/ambient/EntityBat.java
|
||||||
+++ b/net/minecraft/world/entity/ambient/EntityBat.java
|
+++ b/net/minecraft/world/entity/ambient/EntityBat.java
|
||||||
@@ -29,6 +29,8 @@
|
@@ -28,6 +28,8 @@
|
||||||
import net.minecraft.world.level.block.state.IBlockData;
|
import net.minecraft.world.level.block.state.IBlockData;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
public class EntityBat extends EntityAmbient {
|
public class EntityBat extends EntityAmbient {
|
||||||
|
|
||||||
public static final float FLAP_DEGREES_PER_TICK = 74.48451F;
|
public static final float FLAP_DEGREES_PER_TICK = 74.48451F;
|
||||||
@@ -138,16 +140,24 @@
|
@@ -137,16 +139,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.level.getNearestPlayer(EntityBat.BAT_RESTING_TARGETING, this) != null) {
|
if (this.level.getNearestPlayer(EntityBat.BAT_RESTING_TARGETING, this) != null) {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.targetPosition != null && (!this.level.isEmptyBlock(this.targetPosition) || this.targetPosition.getY() <= this.level.getMinBuildHeight())) {
|
if (this.targetPosition != null && (!this.level.isEmptyBlock(this.targetPosition) || this.targetPosition.getY() <= this.level.getMinBuildHeight())) {
|
||||||
@@ -171,7 +181,11 @@
|
@@ -170,7 +180,11 @@
|
||||||
this.zza = 0.5F;
|
this.zza = 0.5F;
|
||||||
this.setYRot(this.getYRot() + f1);
|
this.setYRot(this.getYRot() + f1);
|
||||||
if (this.random.nextInt(100) == 0 && this.level.getBlockState(blockposition1).isRedstoneConductor(this.level, blockposition1)) {
|
if (this.random.nextInt(100) == 0 && this.level.getBlockState(blockposition1).isRedstoneConductor(this.level, blockposition1)) {
|
||||||
@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +215,11 @@
|
@@ -200,7 +214,11 @@
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.level.isClientSide && this.isResting()) {
|
if (!this.level.isClientSide && this.isResting()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityAnimal.java
|
--- a/net/minecraft/world/entity/animal/EntityAnimal.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityAnimal.java
|
+++ b/net/minecraft/world/entity/animal/EntityAnimal.java
|
||||||
@@ -31,12 +31,19 @@
|
@@ -30,12 +30,19 @@
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
import net.minecraft.world.level.pathfinder.PathType;
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) {
|
protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -73,6 +80,9 @@
|
@@ -72,6 +79,9 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public boolean hurt(DamageSource damagesource, float f) {
|
public boolean hurt(DamageSource damagesource, float f) {
|
||||||
if (this.isInvulnerableTo(damagesource)) {
|
if (this.isInvulnerableTo(damagesource)) {
|
||||||
@@ -82,6 +92,7 @@
|
@@ -81,6 +91,7 @@
|
||||||
return super.hurt(damagesource, f);
|
return super.hurt(damagesource, f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getWalkTargetValue(BlockPosition blockposition, IWorldReader iworldreader) {
|
public float getWalkTargetValue(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||||
@@ -178,10 +189,17 @@
|
@@ -177,10 +188,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInLove(@Nullable EntityHuman entityhuman) {
|
public void setInLove(@Nullable EntityHuman entityhuman) {
|
||||||
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
this.level.broadcastEntityEvent(this, (byte) 18);
|
this.level.broadcastEntityEvent(this, (byte) 18);
|
||||||
}
|
}
|
||||||
@@ -221,11 +239,26 @@
|
@@ -220,11 +238,26 @@
|
||||||
EntityAgeable entityageable = this.getBreedOffspring(worldserver, entityanimal);
|
EntityAgeable entityageable = this.getBreedOffspring(worldserver, entityanimal);
|
||||||
|
|
||||||
if (entityageable != null) {
|
if (entityageable != null) {
|
||||||
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
if (entityplayer != null) {
|
if (entityplayer != null) {
|
||||||
entityplayer.awardStat(StatisticList.ANIMALS_BRED);
|
entityplayer.awardStat(StatisticList.ANIMALS_BRED);
|
||||||
@@ -236,12 +269,14 @@
|
@@ -235,12 +268,14 @@
|
||||||
entityanimal.setAge(6000);
|
entityanimal.setAge(6000);
|
||||||
this.resetLove();
|
this.resetLove();
|
||||||
entityanimal.resetLove();
|
entityanimal.resetLove();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityBee.java
|
--- a/net/minecraft/world/entity/animal/EntityBee.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityBee.java
|
+++ b/net/minecraft/world/entity/animal/EntityBee.java
|
||||||
@@ -244,7 +244,7 @@
|
@@ -242,7 +242,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b0 > 0) {
|
if (b0 > 0) {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,11 +644,15 @@
|
@@ -642,11 +642,15 @@
|
||||||
if (this.isInvulnerableTo(damagesource)) {
|
if (this.isInvulnerableTo(damagesource)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -27,7 +27,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1224,7 +1228,7 @@
|
@@ -1222,7 +1226,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
EntityBee.this.level.levelEvent(2005, blockposition, 0);
|
EntityBee.this.level.levelEvent(2005, blockposition, 0);
|
||||||
EntityBee.this.level.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(blockstateinteger, (Integer) iblockdata.getValue(blockstateinteger) + 1));
|
EntityBee.this.level.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(blockstateinteger, (Integer) iblockdata.getValue(blockstateinteger) + 1));
|
||||||
EntityBee.this.incrementNumCropsGrownSincePollination();
|
EntityBee.this.incrementNumCropsGrownSincePollination();
|
||||||
@@ -1297,7 +1301,7 @@
|
@@ -1295,7 +1299,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||||
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
|
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
|
||||||
@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1306,7 +1310,7 @@
|
@@ -1304,7 +1308,7 @@
|
||||||
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||||
|
|
||||||
c(EntityBee entitybee) {
|
c(EntityBee entitybee) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityCat.java
|
--- a/net/minecraft/world/entity/animal/EntityCat.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityCat.java
|
+++ b/net/minecraft/world/entity/animal/EntityCat.java
|
||||||
@@ -434,7 +434,7 @@
|
@@ -443,7 +443,7 @@
|
||||||
}
|
}
|
||||||
} else if (this.isFood(itemstack)) {
|
} else if (this.isFood(itemstack)) {
|
||||||
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
||||||
@ -9,7 +9,7 @@
|
|||||||
this.tame(entityhuman);
|
this.tame(entityhuman);
|
||||||
this.setOrderedToSit(true);
|
this.setOrderedToSit(true);
|
||||||
this.level.broadcastEntityEvent(this, (byte) 7);
|
this.level.broadcastEntityEvent(this, (byte) 7);
|
||||||
@@ -491,7 +491,7 @@
|
@@ -500,7 +500,7 @@
|
||||||
private static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
|
private static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -18,7 +18,7 @@
|
|||||||
private final EntityCat cat;
|
private final EntityCat cat;
|
||||||
|
|
||||||
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, RecipeItemStack recipeitemstack, boolean flag) {
|
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, RecipeItemStack recipeitemstack, boolean flag) {
|
||||||
@@ -632,7 +632,15 @@
|
@@ -641,7 +641,15 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ItemStack itemstack = (ItemStack) iterator.next();
|
ItemStack itemstack = (ItemStack) iterator.next();
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -664,10 +672,10 @@
|
@@ -673,10 +681,10 @@
|
||||||
private final EntityCat cat;
|
private final EntityCat cat;
|
||||||
|
|
||||||
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {
|
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityDolphin.java
|
--- a/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityDolphin.java
|
+++ b/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||||
@@ -65,6 +65,12 @@
|
@@ -63,6 +63,12 @@
|
||||||
|
|
||||||
public class EntityDolphin extends EntityWaterAnimal {
|
public class EntityDolphin extends EntityWaterAnimal {
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
private static final DataWatcherObject<BlockPosition> TREASURE_POS = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BLOCK_POS);
|
private static final DataWatcherObject<BlockPosition> TREASURE_POS = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BLOCK_POS);
|
||||||
private static final DataWatcherObject<Boolean> GOT_FISH = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> GOT_FISH = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BOOLEAN);
|
||||||
private static final DataWatcherObject<Integer> MOISTNESS_LEVEL = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> MOISTNESS_LEVEL = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.INT);
|
||||||
@@ -192,7 +198,7 @@
|
@@ -190,7 +196,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxAirSupply() {
|
public int getMaxAirSupply() {
|
||||||
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -233,6 +239,12 @@
|
@@ -231,6 +237,12 @@
|
||||||
ItemStack itemstack = entityitem.getItem();
|
ItemStack itemstack = entityitem.getItem();
|
||||||
|
|
||||||
if (this.canHoldItem(itemstack)) {
|
if (this.canHoldItem(itemstack)) {
|
||||||
@ -35,7 +35,7 @@
|
|||||||
this.onItemPickup(entityitem);
|
this.onItemPickup(entityitem);
|
||||||
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack);
|
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack);
|
||||||
this.handDropChances[EnumItemSlot.MAINHAND.getIndex()] = 2.0F;
|
this.handDropChances[EnumItemSlot.MAINHAND.getIndex()] = 2.0F;
|
||||||
@@ -391,7 +403,7 @@
|
@@ -389,7 +401,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -501,7 +513,7 @@
|
@@ -489,7 +501,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -520,7 +532,7 @@
|
@@ -508,7 +520,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.player.isSwimming() && this.player.level.random.nextInt(6) == 0) {
|
if (this.player.isSwimming() && this.player.level.random.nextInt(6) == 0) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityFox.java
|
--- a/net/minecraft/world/entity/animal/EntityFox.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityFox.java
|
+++ b/net/minecraft/world/entity/animal/EntityFox.java
|
||||||
@@ -507,7 +507,8 @@
|
@@ -509,7 +509,8 @@
|
||||||
protected void pickUpItem(EntityItem entityitem) {
|
protected void pickUpItem(EntityItem entityitem) {
|
||||||
ItemStack itemstack = entityitem.getItem();
|
ItemStack itemstack = entityitem.getItem();
|
||||||
|
|
||||||
@ -10,7 +10,7 @@
|
|||||||
int i = itemstack.getCount();
|
int i = itemstack.getCount();
|
||||||
|
|
||||||
if (i > 1) {
|
if (i > 1) {
|
||||||
@@ -862,6 +863,16 @@
|
@@ -864,6 +865,16 @@
|
||||||
if (entityplayer1 != null && entityplayer != entityplayer1) {
|
if (entityplayer1 != null && entityplayer != entityplayer1) {
|
||||||
entityfox.addTrustedUUID(entityplayer1.getUUID());
|
entityfox.addTrustedUUID(entityplayer1.getUUID());
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
if (entityplayer2 != null) {
|
if (entityplayer2 != null) {
|
||||||
entityplayer2.awardStat(StatisticList.ANIMALS_BRED);
|
entityplayer2.awardStat(StatisticList.ANIMALS_BRED);
|
||||||
@@ -872,12 +883,14 @@
|
@@ -874,12 +885,14 @@
|
||||||
this.partner.setAge(6000);
|
this.partner.setAge(6000);
|
||||||
this.animal.resetLove();
|
this.animal.resetLove();
|
||||||
this.partner.resetLove();
|
this.partner.resetLove();
|
||||||
@ -46,7 +46,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1268,13 +1281,18 @@
|
@@ -1270,13 +1283,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pickGlowBerry(IBlockData iblockdata) {
|
private void pickGlowBerry(IBlockData iblockdata) {
|
||||||
@ -66,7 +66,7 @@
|
|||||||
int j = 1 + EntityFox.this.level.random.nextInt(2) + (i == 3 ? 1 : 0);
|
int j = 1 + EntityFox.this.level.random.nextInt(2) + (i == 3 ? 1 : 0);
|
||||||
ItemStack itemstack = EntityFox.this.getItemBySlot(EnumItemSlot.MAINHAND);
|
ItemStack itemstack = EntityFox.this.getItemBySlot(EnumItemSlot.MAINHAND);
|
||||||
|
|
||||||
@@ -1431,7 +1449,7 @@
|
@@ -1433,7 +1451,7 @@
|
||||||
private EntityLiving trustedLastHurt;
|
private EntityLiving trustedLastHurt;
|
||||||
private int timestamp;
|
private int timestamp;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
--- a/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
+++ b/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||||
@@ -44,6 +44,13 @@
|
@@ -43,6 +43,13 @@
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
@ -14,7 +14,7 @@
|
|||||||
public class EntityMushroomCow extends EntityCow implements IShearable {
|
public class EntityMushroomCow extends EntityCow implements IShearable {
|
||||||
|
|
||||||
private static final DataWatcherObject<String> DATA_TYPE = DataWatcher.defineId(EntityMushroomCow.class, DataWatcherRegistry.STRING);
|
private static final DataWatcherObject<String> DATA_TYPE = DataWatcher.defineId(EntityMushroomCow.class, DataWatcherRegistry.STRING);
|
||||||
@@ -117,6 +124,11 @@
|
@@ -116,6 +123,11 @@
|
||||||
this.playSound(soundeffect, 1.0F, 1.0F);
|
this.playSound(soundeffect, 1.0F, 1.0F);
|
||||||
return EnumInteractionResult.sidedSuccess(this.level.isClientSide);
|
return EnumInteractionResult.sidedSuccess(this.level.isClientSide);
|
||||||
} else if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
|
} else if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
|
||||||
@ -26,7 +26,7 @@
|
|||||||
this.shear(SoundCategory.PLAYERS);
|
this.shear(SoundCategory.PLAYERS);
|
||||||
this.gameEvent(GameEvent.SHEAR, (Entity) entityhuman);
|
this.gameEvent(GameEvent.SHEAR, (Entity) entityhuman);
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@@ -164,7 +176,7 @@
|
@@ -163,7 +175,7 @@
|
||||||
this.level.playSound((EntityHuman) null, (Entity) this, SoundEffects.MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
|
this.level.playSound((EntityHuman) null, (Entity) this, SoundEffects.MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
|
||||||
if (!this.level.isClientSide()) {
|
if (!this.level.isClientSide()) {
|
||||||
((WorldServer) this.level).sendParticles(Particles.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
|
((WorldServer) this.level).sendParticles(Particles.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||||
@ -35,7 +35,7 @@
|
|||||||
EntityCow entitycow = (EntityCow) EntityTypes.COW.create(this.level);
|
EntityCow entitycow = (EntityCow) EntityTypes.COW.create(this.level);
|
||||||
|
|
||||||
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||||
@@ -180,10 +192,25 @@
|
@@ -179,10 +191,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entitycow.setInvulnerable(this.isInvulnerable());
|
entitycow.setInvulnerable(this.isInvulnerable());
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||||
@@ -134,7 +134,7 @@
|
@@ -133,7 +133,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removeWhenFarAway(double d0) {
|
public boolean removeWhenFarAway(double d0) {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeProvider.Builder createAttributes() {
|
public static AttributeProvider.Builder createAttributes() {
|
||||||
@@ -183,7 +183,8 @@
|
@@ -182,7 +182,8 @@
|
||||||
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && entityhuman.distanceToSqr((Entity) this) < 9.0D) {
|
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && entityhuman.distanceToSqr((Entity) this) < 9.0D) {
|
||||||
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -19,7 +19,7 @@
|
|||||||
this.setTrusting(true);
|
this.setTrusting(true);
|
||||||
this.spawnTrustingParticles(true);
|
this.spawnTrustingParticles(true);
|
||||||
this.level.broadcastEntityEvent(this, (byte) 41);
|
this.level.broadcastEntityEvent(this, (byte) 41);
|
||||||
@@ -313,10 +314,10 @@
|
@@ -312,10 +313,10 @@
|
||||||
private final EntityOcelot ocelot;
|
private final EntityOcelot ocelot;
|
||||||
|
|
||||||
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {
|
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
this.onItemPickup(entityitem);
|
this.onItemPickup(entityitem);
|
||||||
ItemStack itemstack = entityitem.getItem();
|
ItemStack itemstack = entityitem.getItem();
|
||||||
|
|
||||||
@@ -882,10 +884,10 @@
|
@@ -872,10 +874,10 @@
|
||||||
private final EntityPanda panda;
|
private final EntityPanda panda;
|
||||||
|
|
||||||
public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
|
public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
|
||||||
@ -32,7 +32,7 @@
|
|||||||
this.panda = entitypanda;
|
this.panda = entitypanda;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,7 +1134,7 @@
|
@@ -1114,7 +1116,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||||
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {
|
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityParrot.java
|
--- a/net/minecraft/world/entity/animal/EntityParrot.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
|
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
|
||||||
@@ -258,7 +258,7 @@
|
@@ -256,7 +256,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
this.tame(entityhuman);
|
this.tame(entityhuman);
|
||||||
this.level.broadcastEntityEvent(this, (byte) 7);
|
this.level.broadcastEntityEvent(this, (byte) 7);
|
||||||
} else {
|
} else {
|
||||||
@@ -272,7 +272,7 @@
|
@@ -270,7 +270,7 @@
|
||||||
itemstack.shrink(1);
|
itemstack.shrink(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
||||||
this.hurt(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
|
this.hurt(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
|
||||||
}
|
}
|
||||||
@@ -384,7 +384,7 @@
|
@@ -382,7 +382,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPushable() {
|
public boolean isPushable() {
|
||||||
@ -27,12 +27,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -399,7 +399,7 @@
|
@@ -398,7 +398,7 @@
|
||||||
if (this.isInvulnerableTo(damagesource)) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
if (!this.level.isClientSide) {
|
||||||
- this.setOrderedToSit(false);
|
- this.setOrderedToSit(false);
|
||||||
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
||||||
|
}
|
||||||
|
|
||||||
return super.hurt(damagesource, f);
|
return super.hurt(damagesource, f);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||||
@@ -88,8 +88,14 @@
|
@@ -89,8 +89,14 @@
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
|
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
|
||||||
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
|
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerGoals() {
|
public void registerGoals() {
|
||||||
@@ -556,9 +562,23 @@
|
@@ -558,9 +564,23 @@
|
||||||
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
|
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
private static final DataWatcherObject<Byte> DATA_PUMPKIN_ID = DataWatcher.defineId(EntitySnowman.class, DataWatcherRegistry.BYTE);
|
private static final DataWatcherObject<Byte> DATA_PUMPKIN_ID = DataWatcher.defineId(EntitySnowman.class, DataWatcherRegistry.BYTE);
|
||||||
@@ -103,7 +107,7 @@
|
@@ -103,7 +107,7 @@
|
||||||
BiomeBase biomebase = this.level.getBiome(blockposition);
|
BiomeBase biomebase = (BiomeBase) this.level.getBiome(blockposition).value();
|
||||||
|
|
||||||
if (biomebase.shouldSnowGolemBurn(blockposition)) {
|
if (biomebase.shouldSnowGolemBurn(blockposition)) {
|
||||||
- this.hurt(DamageSource.ON_FIRE, 1.0F);
|
- this.hurt(DamageSource.ON_FIRE, 1.0F);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
|
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
|
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||||
@@ -311,7 +311,9 @@
|
@@ -309,7 +309,9 @@
|
||||||
protected void ageBoundaryReached() {
|
protected void ageBoundaryReached() {
|
||||||
super.ageBoundaryReached();
|
super.ageBoundaryReached();
|
||||||
if (!this.isBaby() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
if (!this.isBaby() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||||
@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -338,7 +340,9 @@
|
@@ -336,7 +338,9 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
||||||
@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class e extends ControllerMove {
|
private static class e extends ControllerMove {
|
||||||
@@ -484,8 +488,12 @@
|
@@ -482,8 +486,12 @@
|
||||||
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
|
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
|
||||||
World world = this.turtle.level;
|
World world = this.turtle.level;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityWolf.java
|
--- a/net/minecraft/world/entity/animal/EntityWolf.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityWolf.java
|
+++ b/net/minecraft/world/entity/animal/EntityWolf.java
|
||||||
@@ -68,6 +68,11 @@
|
@@ -69,6 +69,11 @@
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable {
|
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable {
|
||||||
|
|
||||||
private static final DataWatcherObject<Boolean> DATA_INTERESTED_ID = DataWatcher.defineId(EntityWolf.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> DATA_INTERESTED_ID = DataWatcher.defineId(EntityWolf.class, DataWatcherRegistry.BOOLEAN);
|
||||||
@@ -122,6 +127,24 @@
|
@@ -126,6 +131,24 @@
|
||||||
return EntityInsentient.createMobAttributes().add(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).add(GenericAttributes.MAX_HEALTH, 8.0D).add(GenericAttributes.ATTACK_DAMAGE, 2.0D);
|
return EntityInsentient.createMobAttributes().add(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).add(GenericAttributes.MAX_HEALTH, 8.0D).add(GenericAttributes.ATTACK_DAMAGE, 2.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,16 +37,16 @@
|
|||||||
@Override
|
@Override
|
||||||
protected void defineSynchedData() {
|
protected void defineSynchedData() {
|
||||||
super.defineSynchedData();
|
super.defineSynchedData();
|
||||||
@@ -293,7 +316,7 @@
|
@@ -298,7 +321,7 @@
|
||||||
} else {
|
|
||||||
Entity entity = damagesource.getEntity();
|
Entity entity = damagesource.getEntity();
|
||||||
|
|
||||||
|
if (!this.level.isClientSide) {
|
||||||
- this.setOrderedToSit(false);
|
- this.setOrderedToSit(false);
|
||||||
+ // this.setWillSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
||||||
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
|
|
||||||
f = (f + 1.0F) / 2.0F;
|
|
||||||
}
|
}
|
||||||
@@ -318,7 +341,7 @@
|
|
||||||
|
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
|
||||||
|
@@ -325,7 +348,7 @@
|
||||||
super.setTame(flag);
|
super.setTame(flag);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(20.0D);
|
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(20.0D);
|
||||||
@ -55,7 +55,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(8.0D);
|
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(8.0D);
|
||||||
}
|
}
|
||||||
@@ -342,7 +365,7 @@
|
@@ -349,7 +372,7 @@
|
||||||
itemstack.shrink(1);
|
itemstack.shrink(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@
|
|||||||
this.gameEvent(GameEvent.MOB_INTERACT, this.eyeBlockPosition());
|
this.gameEvent(GameEvent.MOB_INTERACT, this.eyeBlockPosition());
|
||||||
return EnumInteractionResult.SUCCESS;
|
return EnumInteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -354,7 +377,7 @@
|
@@ -361,7 +384,7 @@
|
||||||
this.setOrderedToSit(!this.isOrderedToSit());
|
this.setOrderedToSit(!this.isOrderedToSit());
|
||||||
this.jumping = false;
|
this.jumping = false;
|
||||||
this.navigation.stop();
|
this.navigation.stop();
|
||||||
@ -73,7 +73,7 @@
|
|||||||
return EnumInteractionResult.SUCCESS;
|
return EnumInteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +399,8 @@
|
@@ -383,7 +406,8 @@
|
||||||
itemstack.shrink(1);
|
itemstack.shrink(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||||
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||||
@@ -67,9 +67,16 @@
|
@@ -68,10 +68,17 @@
|
||||||
|
|
||||||
public class Axolotl extends EntityAnimal implements LerpingModel, Bucketable {
|
public class Axolotl extends EntityAnimal implements LerpingModel, Bucketable {
|
||||||
|
|
||||||
@ -10,6 +10,7 @@
|
|||||||
+ return AXOLOTL_TOTAL_AIR_SUPPLY;
|
+ return AXOLOTL_TOTAL_AIR_SUPPLY;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
public static final int TOTAL_PLAYDEAD_TIME = 200;
|
public static final int TOTAL_PLAYDEAD_TIME = 200;
|
||||||
protected static final ImmutableList<? extends SensorType<? extends Sensor<? super Axolotl>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_ADULT, SensorType.HURT_BY, SensorType.AXOLOTL_ATTACKABLES, SensorType.AXOLOTL_TEMPTATIONS);
|
protected static final ImmutableList<? extends SensorType<? extends Sensor<? super Axolotl>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_ADULT, SensorType.HURT_BY, SensorType.AXOLOTL_ATTACKABLES, SensorType.AXOLOTL_TEMPTATIONS);
|
||||||
- protected static final ImmutableList<? extends MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT, new MemoryModuleType[]{MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.PLAY_DEAD_TICKS, MemoryModuleType.NEAREST_ATTACKABLE, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.HAS_HUNTING_COOLDOWN});
|
- protected static final ImmutableList<? extends MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT, new MemoryModuleType[]{MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.PLAY_DEAD_TICKS, MemoryModuleType.NEAREST_ATTACKABLE, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.HAS_HUNTING_COOLDOWN});
|
||||||
@ -18,7 +19,7 @@
|
|||||||
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.INT);
|
||||||
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
||||||
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
||||||
@@ -185,7 +192,7 @@
|
@@ -187,7 +194,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxAirSupply() {
|
public int getMaxAirSupply() {
|
||||||
@ -27,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Axolotl.Variant getVariant() {
|
public Axolotl.Variant getVariant() {
|
||||||
@@ -236,6 +243,7 @@
|
@@ -238,6 +245,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void setFromBucket(boolean flag) {
|
public void setFromBucket(boolean flag) {
|
||||||
this.entityData.set(Axolotl.FROM_BUCKET, flag);
|
this.entityData.set(Axolotl.FROM_BUCKET, flag);
|
||||||
@ -35,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -419,7 +427,7 @@
|
@@ -428,7 +436,7 @@
|
||||||
|
|
||||||
if (i < 2400) {
|
if (i < 2400) {
|
||||||
i = Math.min(2400, 100 + i);
|
i = Math.min(2400, 100 + i);
|
||||||
@ -44,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
|
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
|
||||||
@@ -469,7 +477,7 @@
|
@@ -478,7 +486,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BehaviorController<Axolotl> getBrain() {
|
public BehaviorController<Axolotl> getBrain() {
|
||||||
@ -53,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -502,7 +510,7 @@
|
@@ -511,7 +519,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removeWhenFarAway(double d0) {
|
public boolean removeWhenFarAway(double d0) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
||||||
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||||
@@ -52,6 +52,11 @@
|
@@ -45,6 +45,11 @@
|
||||||
import net.minecraft.world.level.pathfinder.Pathfinder;
|
import net.minecraft.world.level.block.state.IBlockData;
|
||||||
import net.minecraft.world.level.pathfinder.PathfinderNormal;
|
import net.minecraft.world.level.pathfinder.PathType;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class Goat extends EntityAnimal {
|
public class Goat extends EntityAnimal {
|
||||||
|
|
||||||
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.scalable(0.9F, 1.3F).scale(0.7F);
|
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.scalable(0.9F, 1.3F).scale(0.7F);
|
||||||
@@ -139,7 +144,7 @@
|
@@ -134,7 +139,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BehaviorController<Goat> getBrain() {
|
public BehaviorController<Goat> getBrain() {
|
||||||
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -177,8 +182,15 @@
|
@@ -172,8 +177,15 @@
|
||||||
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
|
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
|
||||||
|
|
||||||
if (itemstack.is(Items.BUCKET) && !this.isBaby()) {
|
if (itemstack.is(Items.BUCKET) && !this.isBaby()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/horse/EntityLlama.java
|
--- a/net/minecraft/world/entity/animal/horse/EntityLlama.java
|
||||||
+++ b/net/minecraft/world/entity/animal/horse/EntityLlama.java
|
+++ b/net/minecraft/world/entity/animal/horse/EntityLlama.java
|
||||||
@@ -78,6 +78,12 @@
|
@@ -77,6 +77,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||||
@@ -53,6 +53,18 @@
|
@@ -51,6 +51,18 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.item.ItemStack;
|
+import net.minecraft.world.item.ItemStack;
|
||||||
@ -18,8 +18,8 @@
|
|||||||
+
|
+
|
||||||
public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -89,6 +101,7 @@
|
@@ -87,6 +99,7 @@
|
||||||
private final PathPoint[] nodes = new PathPoint[24];
|
private final PathPoint[] nodes = new PathPoint[24];
|
||||||
private final int[] nodeAdjacency = new int[24];
|
private final int[] nodeAdjacency = new int[24];
|
||||||
private final Path openSet = new Path();
|
private final Path openSet = new Path();
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
|
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
|
||||||
super(EntityTypes.ENDER_DRAGON, world);
|
super(EntityTypes.ENDER_DRAGON, world);
|
||||||
@@ -236,7 +249,7 @@
|
@@ -234,7 +247,7 @@
|
||||||
|
|
||||||
Vec3D vec3d1 = idragoncontroller.getFlyTargetLocation();
|
Vec3D vec3d1 = idragoncontroller.getFlyTargetLocation();
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
d0 = vec3d1.x - this.getX();
|
d0 = vec3d1.x - this.getX();
|
||||||
d1 = vec3d1.y - this.getY();
|
d1 = vec3d1.y - this.getY();
|
||||||
d2 = vec3d1.z - this.getZ();
|
d2 = vec3d1.z - this.getZ();
|
||||||
@@ -378,7 +391,14 @@
|
@@ -375,7 +388,14 @@
|
||||||
if (this.nearestCrystal.isRemoved()) {
|
if (this.nearestCrystal.isRemoved()) {
|
||||||
this.nearestCrystal = null;
|
this.nearestCrystal = null;
|
||||||
} else if (this.tickCount % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
|
} else if (this.tickCount % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
|
||||||
@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,6 +473,9 @@
|
@@ -450,6 +470,9 @@
|
||||||
int j1 = MathHelper.floor(axisalignedbb.maxZ);
|
int j1 = MathHelper.floor(axisalignedbb.maxZ);
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
@ -62,10 +62,10 @@
|
|||||||
|
|
||||||
for (int k1 = i; k1 <= l; ++k1) {
|
for (int k1 = i; k1 <= l; ++k1) {
|
||||||
for (int l1 = j; l1 <= i1; ++l1) {
|
for (int l1 = j; l1 <= i1; ++l1) {
|
||||||
@@ -462,7 +485,11 @@
|
@@ -459,7 +482,11 @@
|
||||||
|
|
||||||
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
|
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
|
||||||
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is((Tag) TagsBlock.DRAGON_IMMUNE)) {
|
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is(TagsBlock.DRAGON_IMMUNE)) {
|
||||||
- flag1 = this.level.removeBlock(blockposition, false) || flag1;
|
- flag1 = this.level.removeBlock(blockposition, false) || flag1;
|
||||||
+ // CraftBukkit start - Add blocks to list rather than destroying them
|
+ // CraftBukkit start - Add blocks to list rather than destroying them
|
||||||
+ // flag1 = this.level.removeBlock(blockposition, false) || flag1;
|
+ // flag1 = this.level.removeBlock(blockposition, false) || flag1;
|
||||||
@ -75,7 +75,7 @@
|
|||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
@@ -471,6 +498,51 @@
|
@@ -468,6 +495,51 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
||||||
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
||||||
@@ -5,6 +5,11 @@
|
@@ -5,6 +5,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
|
+import org.bukkit.craftbukkit.entity.CraftEnderDragon;
|
||||||
@ -11,7 +11,7 @@
|
|||||||
+
|
+
|
||||||
public class DragonControllerManager {
|
public class DragonControllerManager {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -24,6 +29,19 @@
|
@@ -24,6 +29,19 @@
|
||||||
this.currentPhase.end();
|
this.currentPhase.end();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
|
--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||||
+++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
|
+++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||||
@@ -56,6 +56,17 @@
|
@@ -55,6 +55,17 @@
|
||||||
import net.minecraft.world.level.block.state.IBlockData;
|
import net.minecraft.world.level.block.state.IBlockData;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
public class EntityWither extends EntityMonster implements PowerableMob, IRangedEntity {
|
public class EntityWither extends EntityMonster implements PowerableMob, IRangedEntity {
|
||||||
|
|
||||||
private static final DataWatcherObject<Integer> DATA_TARGET_A = DataWatcher.defineId(EntityWither.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_TARGET_A = DataWatcher.defineId(EntityWither.class, DataWatcherRegistry.INT);
|
||||||
@@ -250,16 +261,40 @@
|
@@ -249,16 +260,40 @@
|
||||||
this.bossEvent.setProgress(1.0F - (float) i / 220.0F);
|
this.bossEvent.setProgress(1.0F - (float) i / 220.0F);
|
||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
Explosion.Effect explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
Explosion.Effect explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||||
@ -62,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -304,6 +339,7 @@
|
@@ -303,6 +338,7 @@
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
EntityLiving entityliving1 = (EntityLiving) list.get(this.random.nextInt(list.size()));
|
EntityLiving entityliving1 = (EntityLiving) list.get(this.random.nextInt(list.size()));
|
||||||
|
|
||||||
@ -70,7 +70,7 @@
|
|||||||
this.setAlternativeTarget(i, entityliving1.getId());
|
this.setAlternativeTarget(i, entityliving1.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -334,6 +370,11 @@
|
@@ -333,6 +369,11 @@
|
||||||
IBlockData iblockdata = this.level.getBlockState(blockposition);
|
IBlockData iblockdata = this.level.getBlockState(blockposition);
|
||||||
|
|
||||||
if (canDestroy(iblockdata)) {
|
if (canDestroy(iblockdata)) {
|
||||||
@ -82,7 +82,7 @@
|
|||||||
flag = this.level.destroyBlock(blockposition, true, this) || flag;
|
flag = this.level.destroyBlock(blockposition, true, this) || flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -347,7 +388,7 @@
|
@@ -346,7 +387,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tickCount % 20 == 0) {
|
if (this.tickCount % 20 == 0) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/decoration/EntityLeash.java
|
--- a/net/minecraft/world/entity/decoration/EntityLeash.java
|
||||||
+++ b/net/minecraft/world/entity/decoration/EntityLeash.java
|
+++ b/net/minecraft/world/entity/decoration/EntityLeash.java
|
||||||
@@ -25,6 +25,12 @@
|
@@ -24,6 +24,12 @@
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
public class EntityLeash extends EntityHanging {
|
public class EntityLeash extends EntityHanging {
|
||||||
|
|
||||||
public static final double OFFSET_Y = 0.375D;
|
public static final double OFFSET_Y = 0.375D;
|
||||||
@@ -96,22 +102,42 @@
|
@@ -95,22 +101,42 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
entityinsentient = (EntityInsentient) iterator.next();
|
entityinsentient = (EntityInsentient) iterator.next();
|
||||||
if (entityinsentient.getLeashHolder() == entityhuman) {
|
if (entityinsentient.getLeashHolder() == entityhuman) {
|
||||||
|
@ -1,24 +1,15 @@
|
|||||||
--- a/net/minecraft/world/entity/item/EntityFallingBlock.java
|
--- a/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||||
+++ b/net/minecraft/world/entity/item/EntityFallingBlock.java
|
+++ b/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||||
@@ -45,6 +45,8 @@
|
@@ -46,6 +46,8 @@
|
||||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||||
+
|
+
|
||||||
public class EntityFallingBlock extends Entity {
|
public class EntityFallingBlock extends Entity {
|
||||||
|
|
||||||
private static final int REMOVAL_DELAY_MILLIS = 50;
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -122,7 +124,7 @@
|
@@ -166,6 +168,12 @@
|
||||||
|
|
||||||
if (this.time++ == 0) {
|
|
||||||
blockposition = this.blockPosition();
|
|
||||||
- if (this.level.getBlockState(blockposition).is(block)) {
|
|
||||||
+ if (this.level.getBlockState(blockposition).is(block) && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
|
||||||
this.level.removeBlock(blockposition, false);
|
|
||||||
} else if (!this.level.isClientSide) {
|
|
||||||
this.discard();
|
|
||||||
@@ -173,6 +175,12 @@
|
|
||||||
this.blockState = (IBlockData) this.blockState.setValue(BlockProperties.WATERLOGGED, true);
|
this.blockState = (IBlockData) this.blockState.setValue(BlockProperties.WATERLOGGED, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +22,7 @@
|
|||||||
if (this.level.setBlock(blockposition, this.blockState, 3)) {
|
if (this.level.setBlock(blockposition, this.blockState, 3)) {
|
||||||
((WorldServer) this.level).getChunkSource().chunkMap.broadcast(this, new PacketPlayOutBlockChange(blockposition, this.level.getBlockState(blockposition)));
|
((WorldServer) this.level).getChunkSource().chunkMap.broadcast(this, new PacketPlayOutBlockChange(blockposition, this.level.getBlockState(blockposition)));
|
||||||
this.discard();
|
this.discard();
|
||||||
@@ -252,7 +260,7 @@
|
@@ -236,7 +244,7 @@
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -40,7 +31,7 @@
|
|||||||
DamageSource damagesource1;
|
DamageSource damagesource1;
|
||||||
|
|
||||||
if (this.blockState.getBlock() instanceof Fallable) {
|
if (this.blockState.getBlock() instanceof Fallable) {
|
||||||
@@ -268,7 +276,9 @@
|
@@ -252,7 +260,9 @@
|
||||||
float f2 = (float) Math.min(MathHelper.floor((float) i * this.fallDamagePerDistance), this.fallDamageMax);
|
float f2 = (float) Math.min(MathHelper.floor((float) i * this.fallDamagePerDistance), this.fallDamageMax);
|
||||||
|
|
||||||
this.level.getEntities((Entity) this, this.getBoundingBox(), predicate).forEach((entity) -> {
|
this.level.getEntities((Entity) this, this.getBoundingBox(), predicate).forEach((entity) -> {
|
||||||
@ -48,5 +39,5 @@
|
|||||||
entity.hurt(damagesource1, f2);
|
entity.hurt(damagesource1, f2);
|
||||||
+ CraftEventFactory.entityDamage = null; // CraftBukkit
|
+ CraftEventFactory.entityDamage = null; // CraftBukkit
|
||||||
});
|
});
|
||||||
boolean flag = this.blockState.is((Tag) TagsBlock.ANVIL);
|
boolean flag = this.blockState.is(TagsBlock.ANVIL);
|
||||||
|
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
merge(entityitem, itemstack, itemstack1);
|
merge(entityitem, itemstack, itemstack1);
|
||||||
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
|
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
|
||||||
entityitem.age = Math.min(entityitem.age, entityitem1.age);
|
entityitem.age = Math.min(entityitem.age, entityitem1.age);
|
||||||
@@ -263,6 +282,11 @@
|
@@ -265,6 +284,11 @@
|
||||||
} else if (!this.getItem().getItem().canBeHurtBy(damagesource)) {
|
} else if (this.level.isClientSide) {
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
||||||
@ -87,7 +87,7 @@
|
|||||||
this.markHurt();
|
this.markHurt();
|
||||||
this.health = (int) ((float) this.health - f);
|
this.health = (int) ((float) this.health - f);
|
||||||
this.gameEvent(GameEvent.ENTITY_DAMAGED, damagesource.getEntity());
|
this.gameEvent(GameEvent.ENTITY_DAMAGED, damagesource.getEntity());
|
||||||
@@ -326,6 +350,46 @@
|
@@ -328,6 +352,46 @@
|
||||||
Item item = itemstack.getItem();
|
Item item = itemstack.getItem();
|
||||||
int i = itemstack.getCount();
|
int i = itemstack.getCount();
|
||||||
|
|
||||||
@ -134,7 +134,7 @@
|
|||||||
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUUID())) && entityhuman.getInventory().add(itemstack)) {
|
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUUID())) && entityhuman.getInventory().add(itemstack)) {
|
||||||
entityhuman.take(this, i);
|
entityhuman.take(this, i);
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
@@ -369,7 +433,9 @@
|
@@ -371,7 +435,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItem(ItemStack itemstack) {
|
public void setItem(ItemStack itemstack) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
|
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
|
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||||
@@ -110,7 +110,17 @@
|
@@ -109,7 +109,17 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTarget(@Nullable EntityLiving entityliving) {
|
public void setTarget(@Nullable EntityLiving entityliving) {
|
||||||
@ -19,7 +19,7 @@
|
|||||||
AttributeModifiable attributemodifiable = this.getAttribute(GenericAttributes.MOVEMENT_SPEED);
|
AttributeModifiable attributemodifiable = this.getAttribute(GenericAttributes.MOVEMENT_SPEED);
|
||||||
|
|
||||||
if (entityliving == null) {
|
if (entityliving == null) {
|
||||||
@@ -125,6 +135,7 @@
|
@@ -124,6 +134,7 @@
|
||||||
attributemodifiable.addTransientModifier(EntityEnderman.SPEED_MODIFIER_ATTACKING);
|
attributemodifiable.addTransientModifier(EntityEnderman.SPEED_MODIFIER_ATTACKING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,9 +482,13 @@
|
@@ -470,9 +481,13 @@
|
||||||
if (iblockdata2 != null) {
|
if (iblockdata2 != null) {
|
||||||
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level, blockposition);
|
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level, blockposition);
|
||||||
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||||
@ -41,10 +41,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -512,9 +527,13 @@
|
@@ -511,9 +526,13 @@
|
||||||
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
|
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
|
||||||
|
|
||||||
if (iblockdata.is((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
if (iblockdata.is(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||||
- world.removeBlock(blockposition, false);
|
- world.removeBlock(blockposition, false);
|
||||||
- world.gameEvent(this.enderman, GameEvent.BLOCK_DESTROY, blockposition);
|
- world.gameEvent(this.enderman, GameEvent.BLOCK_DESTROY, blockposition);
|
||||||
- this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
|
- this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
|
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
|
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||||
@@ -173,6 +173,11 @@
|
@@ -175,6 +175,11 @@
|
||||||
Block block = iblockdata.getBlock();
|
Block block = iblockdata.getBlock();
|
||||||
|
|
||||||
if (block instanceof BlockMonsterEggs) {
|
if (block instanceof BlockMonsterEggs) {
|
||||||
@ -12,7 +12,7 @@
|
|||||||
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
||||||
world.destroyBlock(blockposition1, true, this.silverfish);
|
world.destroyBlock(blockposition1, true, this.silverfish);
|
||||||
} else {
|
} else {
|
||||||
@@ -242,6 +247,11 @@
|
@@ -244,6 +249,11 @@
|
||||||
IBlockData iblockdata = world.getBlockState(blockposition);
|
IBlockData iblockdata = world.getBlockState(blockposition);
|
||||||
|
|
||||||
if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) {
|
if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntitySlime.java
|
--- a/net/minecraft/world/entity/monster/EntitySlime.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EntitySlime.java
|
+++ b/net/minecraft/world/entity/monster/EntitySlime.java
|
||||||
@@ -45,6 +45,14 @@
|
@@ -43,6 +43,14 @@
|
||||||
import net.minecraft.world.level.storage.loot.LootTables;
|
import net.minecraft.world.level.storage.loot.LootTables;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
public class EntitySlime extends EntityInsentient implements IMonster {
|
public class EntitySlime extends EntityInsentient implements IMonster {
|
||||||
|
|
||||||
private static final DataWatcherObject<Integer> ID_SIZE = DataWatcher.defineId(EntitySlime.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> ID_SIZE = DataWatcher.defineId(EntitySlime.class, DataWatcherRegistry.INT);
|
||||||
@@ -186,7 +194,7 @@
|
@@ -184,7 +192,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityTypes<? extends EntitySlime> getType() {
|
public EntityTypes<? extends EntitySlime> getType() {
|
||||||
@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -200,6 +208,19 @@
|
@@ -198,6 +206,19 @@
|
||||||
int j = i / 2;
|
int j = i / 2;
|
||||||
int k = 2 + this.random.nextInt(3);
|
int k = 2 + this.random.nextInt(3);
|
||||||
|
|
||||||
@ -44,7 +44,7 @@
|
|||||||
for (int l = 0; l < k; ++l) {
|
for (int l = 0; l < k; ++l) {
|
||||||
float f1 = ((float) (l % 2) - 0.5F) * f;
|
float f1 = ((float) (l % 2) - 0.5F) * f;
|
||||||
float f2 = ((float) (l / 2) - 0.5F) * f;
|
float f2 = ((float) (l / 2) - 0.5F) * f;
|
||||||
@@ -214,8 +235,18 @@
|
@@ -212,8 +233,18 @@
|
||||||
entityslime.setInvulnerable(this.isInvulnerable());
|
entityslime.setInvulnerable(this.isInvulnerable());
|
||||||
entityslime.setSize(j, true);
|
entityslime.setSize(j, true);
|
||||||
entityslime.moveTo(this.getX() + (double) f1, this.getY() + 0.5D, this.getZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
|
entityslime.moveTo(this.getX() + (double) f1, this.getY() + 0.5D, this.getZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntityStrider.java
|
--- a/net/minecraft/world/entity/monster/EntityStrider.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EntityStrider.java
|
+++ b/net/minecraft/world/entity/monster/EntityStrider.java
|
||||||
@@ -321,7 +321,13 @@
|
@@ -320,7 +320,13 @@
|
||||||
IBlockData iblockdata1 = this.getBlockStateOn();
|
IBlockData iblockdata1 = this.getBlockStateOn();
|
||||||
boolean flag = iblockdata.is((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.is((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.getFluidHeight(TagsFluid.LAVA) > 0.0D;
|
boolean flag = iblockdata.is(TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.is(TagsBlock.STRIDER_WARM_BLOCKS) || this.getFluidHeight(TagsFluid.LAVA) > 0.0D;
|
||||||
|
|
||||||
- this.setSuffocating(!flag);
|
- this.setSuffocating(!flag);
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntityZombieVillager.java
|
--- a/net/minecraft/world/entity/monster/EntityZombieVillager.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EntityZombieVillager.java
|
+++ b/net/minecraft/world/entity/monster/EntityZombieVillager.java
|
||||||
@@ -47,6 +47,13 @@
|
@@ -48,6 +48,13 @@
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.server.MinecraftServer;
|
+import net.minecraft.server.MinecraftServer;
|
||||||
@ -13,8 +13,8 @@
|
|||||||
+
|
+
|
||||||
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
|
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
|
||||||
|
|
||||||
public static final DataWatcherObject<Boolean> DATA_CONVERTING_ID = DataWatcher.defineId(EntityZombieVillager.class, DataWatcherRegistry.BOOLEAN);
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -63,6 +70,7 @@
|
@@ -65,6 +72,7 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
private NBTTagCompound tradeOffers;
|
private NBTTagCompound tradeOffers;
|
||||||
private int villagerXp;
|
private int villagerXp;
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -79,7 +87,7 @@
|
@@ -83,7 +91,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||||
super.addAdditionalSaveData(nbttagcompound);
|
super.addAdditionalSaveData(nbttagcompound);
|
||||||
@ -31,7 +31,7 @@
|
|||||||
Logger logger = EntityZombieVillager.LOGGER;
|
Logger logger = EntityZombieVillager.LOGGER;
|
||||||
|
|
||||||
Objects.requireNonNull(logger);
|
Objects.requireNonNull(logger);
|
||||||
@@ -135,6 +143,10 @@
|
@@ -139,6 +147,10 @@
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (!this.level.isClientSide && this.isAlive() && this.isConverting()) {
|
if (!this.level.isClientSide && this.isAlive() && this.isConverting()) {
|
||||||
int i = this.getConversionProgress();
|
int i = this.getConversionProgress();
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
this.villagerConversionTime -= i;
|
this.villagerConversionTime -= i;
|
||||||
if (this.villagerConversionTime <= 0) {
|
if (this.villagerConversionTime <= 0) {
|
||||||
@@ -143,6 +155,7 @@
|
@@ -147,6 +159,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
super.tick();
|
super.tick();
|
||||||
@ -50,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -187,8 +200,11 @@
|
@@ -191,8 +204,11 @@
|
||||||
this.conversionStarter = uuid;
|
this.conversionStarter = uuid;
|
||||||
this.villagerConversionTime = i;
|
this.villagerConversionTime = i;
|
||||||
this.getEntityData().set(EntityZombieVillager.DATA_CONVERTING_ID, true);
|
this.getEntityData().set(EntityZombieVillager.DATA_CONVERTING_ID, true);
|
||||||
@ -64,7 +64,7 @@
|
|||||||
this.level.broadcastEntityEvent(this, (byte) 16);
|
this.level.broadcastEntityEvent(this, (byte) 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +221,13 @@
|
@@ -209,7 +225,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finishConversion(WorldServer worldserver) {
|
private void finishConversion(WorldServer worldserver) {
|
||||||
@ -79,7 +79,7 @@
|
|||||||
EnumItemSlot[] aenumitemslot = EnumItemSlot.values();
|
EnumItemSlot[] aenumitemslot = EnumItemSlot.values();
|
||||||
int i = aenumitemslot.length;
|
int i = aenumitemslot.length;
|
||||||
|
|
||||||
@@ -220,7 +242,9 @@
|
@@ -224,7 +246,9 @@
|
||||||
double d0 = (double) this.getEquipmentDropChance(enumitemslot);
|
double d0 = (double) this.getEquipmentDropChance(enumitemslot);
|
||||||
|
|
||||||
if (d0 > 1.0D) {
|
if (d0 > 1.0D) {
|
||||||
@ -89,7 +89,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,7 +270,7 @@
|
@@ -250,7 +274,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/piglin/PiglinAI.java
|
--- a/net/minecraft/world/entity/monster/piglin/PiglinAI.java
|
||||||
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAI.java
|
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAI.java
|
||||||
@@ -72,6 +72,13 @@
|
@@ -71,6 +71,13 @@
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -14,7 +14,7 @@
|
|||||||
public class PiglinAI {
|
public class PiglinAI {
|
||||||
|
|
||||||
public static final int REPELLENT_DETECTION_RANGE_HORIZONTAL = 8;
|
public static final int REPELLENT_DETECTION_RANGE_HORIZONTAL = 8;
|
||||||
@@ -187,13 +194,13 @@
|
@@ -186,13 +193,13 @@
|
||||||
|
|
||||||
protected static void updateActivity(EntityPiglin entitypiglin) {
|
protected static void updateActivity(EntityPiglin entitypiglin) {
|
||||||
BehaviorController<EntityPiglin> behaviorcontroller = entitypiglin.getBrain();
|
BehaviorController<EntityPiglin> behaviorcontroller = entitypiglin.getBrain();
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
Objects.requireNonNull(entitypiglin);
|
Objects.requireNonNull(entitypiglin);
|
||||||
optional.ifPresent(entitypiglin::playSound);
|
optional.ifPresent(entitypiglin::playSound);
|
||||||
@@ -225,23 +232,27 @@
|
@@ -224,23 +231,27 @@
|
||||||
stopWalking(entitypiglin);
|
stopWalking(entitypiglin);
|
||||||
ItemStack itemstack;
|
ItemStack itemstack;
|
||||||
|
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
putInInventory(entitypiglin, itemstack);
|
putInInventory(entitypiglin, itemstack);
|
||||||
@@ -277,9 +288,14 @@
|
@@ -276,9 +287,14 @@
|
||||||
boolean flag1;
|
boolean flag1;
|
||||||
|
|
||||||
if (entitypiglin.isAdult()) {
|
if (entitypiglin.isAdult()) {
|
||||||
@ -80,7 +80,7 @@
|
|||||||
} else if (!flag1) {
|
} else if (!flag1) {
|
||||||
boolean flag2 = entitypiglin.equipItemIfPossible(itemstack);
|
boolean flag2 = entitypiglin.equipItemIfPossible(itemstack);
|
||||||
|
|
||||||
@@ -292,7 +308,7 @@
|
@@ -291,7 +307,7 @@
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
ItemStack itemstack1 = entitypiglin.getMainHandItem();
|
ItemStack itemstack1 = entitypiglin.getMainHandItem();
|
||||||
|
|
||||||
@ -89,7 +89,7 @@
|
|||||||
putInInventory(entitypiglin, itemstack1);
|
putInInventory(entitypiglin, itemstack1);
|
||||||
} else {
|
} else {
|
||||||
throwItems(entitypiglin, Collections.singletonList(itemstack1));
|
throwItems(entitypiglin, Collections.singletonList(itemstack1));
|
||||||
@@ -369,7 +385,7 @@
|
@@ -368,7 +384,7 @@
|
||||||
return false;
|
return false;
|
||||||
} else if (isAdmiringDisabled(entitypiglin) && entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ATTACK_TARGET)) {
|
} else if (isAdmiringDisabled(entitypiglin) && entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ATTACK_TARGET)) {
|
||||||
return false;
|
return false;
|
||||||
@ -98,7 +98,7 @@
|
|||||||
return isNotHoldingLovedItemInOffHand(entitypiglin);
|
return isNotHoldingLovedItemInOffHand(entitypiglin);
|
||||||
} else {
|
} else {
|
||||||
boolean flag = entitypiglin.canAddToInventory(itemstack);
|
boolean flag = entitypiglin.canAddToInventory(itemstack);
|
||||||
@@ -378,6 +394,12 @@
|
@@ -377,6 +393,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +109,9 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
protected static boolean isLovedItem(ItemStack itemstack) {
|
protected static boolean isLovedItem(ItemStack itemstack) {
|
||||||
return itemstack.is((Tag) TagsItem.PIGLIN_LOVED);
|
return itemstack.is(TagsItem.PIGLIN_LOVED);
|
||||||
}
|
}
|
||||||
@@ -473,7 +495,7 @@
|
@@ -472,7 +494,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean canAdmire(EntityPiglin entitypiglin, ItemStack itemstack) {
|
protected static boolean canAdmire(EntityPiglin entitypiglin, ItemStack itemstack) {
|
||||||
@ -120,7 +120,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static void wasHurtBy(EntityPiglin entitypiglin, EntityLiving entityliving) {
|
protected static void wasHurtBy(EntityPiglin entitypiglin, EntityLiving entityliving) {
|
||||||
@@ -740,6 +762,12 @@
|
@@ -739,6 +761,12 @@
|
||||||
return entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ADMIRING_ITEM);
|
return entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ADMIRING_ITEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@
|
|||||||
private static boolean isBarterCurrency(ItemStack itemstack) {
|
private static boolean isBarterCurrency(ItemStack itemstack) {
|
||||||
return itemstack.is(PiglinAI.BARTERING_ITEM);
|
return itemstack.is(PiglinAI.BARTERING_ITEM);
|
||||||
}
|
}
|
||||||
@@ -777,7 +805,7 @@
|
@@ -776,7 +804,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isNotHoldingLovedItemInOffHand(EntityPiglin entitypiglin) {
|
private static boolean isNotHoldingLovedItemInOffHand(EntityPiglin entitypiglin) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/npc/EntityVillager.java
|
--- a/net/minecraft/world/entity/npc/EntityVillager.java
|
||||||
+++ b/net/minecraft/world/entity/npc/EntityVillager.java
|
+++ b/net/minecraft/world/entity/npc/EntityVillager.java
|
||||||
@@ -89,6 +89,14 @@
|
@@ -90,6 +90,14 @@
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.Bukkit;
|
+import org.bukkit.Bukkit;
|
||||||
@ -14,8 +14,8 @@
|
|||||||
+
|
+
|
||||||
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
|
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
|
||||||
|
|
||||||
private static final DataWatcherObject<VillagerData> DATA_VILLAGER_DATA = DataWatcher.defineId(EntityVillager.class, DataWatcherRegistry.VILLAGER_DATA);
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -146,7 +154,7 @@
|
@@ -148,7 +156,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BehaviorController<EntityVillager> getBrain() {
|
public BehaviorController<EntityVillager> getBrain() {
|
||||||
@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -229,7 +237,7 @@
|
@@ -231,7 +239,7 @@
|
||||||
this.increaseProfessionLevelOnUpdate = false;
|
this.increaseProfessionLevelOnUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +365,13 @@
|
@@ -359,7 +367,13 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
||||||
|
|
||||||
@ -48,7 +48,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.lastRestockGameTime = this.level.getGameTime();
|
this.lastRestockGameTime = this.level.getGameTime();
|
||||||
@@ -415,7 +429,13 @@
|
@@ -417,7 +431,13 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
||||||
|
|
||||||
@ -63,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,7 +494,7 @@
|
@@ -476,7 +496,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||||
super.addAdditionalSaveData(nbttagcompound);
|
super.addAdditionalSaveData(nbttagcompound);
|
||||||
@ -72,7 +72,7 @@
|
|||||||
Logger logger = EntityVillager.LOGGER;
|
Logger logger = EntityVillager.LOGGER;
|
||||||
|
|
||||||
Objects.requireNonNull(logger);
|
Objects.requireNonNull(logger);
|
||||||
@@ -816,7 +836,12 @@
|
@@ -818,7 +838,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entitywitch.setPersistenceRequired();
|
entitywitch.setPersistenceRequired();
|
||||||
@ -86,7 +86,7 @@
|
|||||||
this.releaseAllPois();
|
this.releaseAllPois();
|
||||||
this.discard();
|
this.discard();
|
||||||
} else {
|
} else {
|
||||||
@@ -837,6 +862,13 @@
|
@@ -839,6 +864,13 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@
|
|||||||
this.onItemPickup(entityitem);
|
this.onItemPickup(entityitem);
|
||||||
this.take(entityitem, itemstack.getCount());
|
this.take(entityitem, itemstack.getCount());
|
||||||
ItemStack itemstack1 = inventorysubcontainer.addItem(itemstack);
|
ItemStack itemstack1 = inventorysubcontainer.addItem(itemstack);
|
||||||
@@ -949,7 +981,7 @@
|
@@ -951,7 +983,7 @@
|
||||||
|
|
||||||
if (entityirongolem != null) {
|
if (entityirongolem != null) {
|
||||||
if (entityirongolem.checkSpawnRules(worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.checkSpawnObstruction(worldserver)) {
|
if (entityirongolem.checkSpawnRules(worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.checkSpawnObstruction(worldserver)) {
|
||||||
@ -109,7 +109,7 @@
|
|||||||
return entityirongolem;
|
return entityirongolem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,7 +1059,7 @@
|
@@ -1029,7 +1061,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void startSleeping(BlockPosition blockposition) {
|
public void startSleeping(BlockPosition blockposition) {
|
||||||
super.startSleeping(blockposition);
|
super.startSleeping(blockposition);
|
||||||
@ -118,7 +118,7 @@
|
|||||||
this.brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
this.brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
||||||
this.brain.eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
this.brain.eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
||||||
}
|
}
|
||||||
@@ -1035,7 +1067,7 @@
|
@@ -1037,7 +1069,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void stopSleeping() {
|
public void stopSleeping() {
|
||||||
super.stopSleeping();
|
super.stopSleeping();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/npc/EntityVillagerTrader.java
|
--- a/net/minecraft/world/entity/npc/EntityVillagerTrader.java
|
||||||
+++ b/net/minecraft/world/entity/npc/EntityVillagerTrader.java
|
+++ b/net/minecraft/world/entity/npc/EntityVillagerTrader.java
|
||||||
@@ -45,6 +45,13 @@
|
@@ -44,6 +44,13 @@
|
||||||
import net.minecraft.world.level.World;
|
import net.minecraft.world.level.World;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -14,7 +14,7 @@
|
|||||||
public class EntityVillagerTrader extends EntityVillagerAbstract {
|
public class EntityVillagerTrader extends EntityVillagerAbstract {
|
||||||
|
|
||||||
private static final int NUMBER_OF_TRADE_OFFERS = 5;
|
private static final int NUMBER_OF_TRADE_OFFERS = 5;
|
||||||
@@ -54,6 +61,7 @@
|
@@ -53,6 +60,7 @@
|
||||||
|
|
||||||
public EntityVillagerTrader(EntityTypes<? extends EntityVillagerTrader> entitytypes, World world) {
|
public EntityVillagerTrader(EntityTypes<? extends EntityVillagerTrader> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -131,7 +139,16 @@
|
@@ -130,7 +138,16 @@
|
||||||
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.getOffer(this, this.random);
|
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.getOffer(this, this.random);
|
||||||
|
|
||||||
if (merchantrecipe != null) {
|
if (merchantrecipe != null) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/player/EntityHuman.java
|
--- a/net/minecraft/world/entity/player/EntityHuman.java
|
||||||
+++ b/net/minecraft/world/entity/player/EntityHuman.java
|
+++ b/net/minecraft/world/entity/player/EntityHuman.java
|
||||||
@@ -111,6 +111,19 @@
|
@@ -112,6 +112,19 @@
|
||||||
import net.minecraft.world.scores.ScoreboardTeam;
|
import net.minecraft.world.scores.ScoreboardTeam;
|
||||||
import net.minecraft.world.scores.ScoreboardTeamBase;
|
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@
|
|||||||
public abstract class EntityHuman extends EntityLiving {
|
public abstract class EntityHuman extends EntityLiving {
|
||||||
|
|
||||||
public static final String UUID_PREFIX_OFFLINE_PLAYER = "OfflinePlayer:";
|
public static final String UUID_PREFIX_OFFLINE_PLAYER = "OfflinePlayer:";
|
||||||
@@ -124,7 +137,8 @@
|
@@ -125,7 +138,8 @@
|
||||||
public static final float SWIMMING_BB_HEIGHT = 0.6F;
|
public static final float SWIMMING_BB_HEIGHT = 0.6F;
|
||||||
public static final float DEFAULT_EYE_HEIGHT = 1.62F;
|
public static final float DEFAULT_EYE_HEIGHT = 1.62F;
|
||||||
public static final EntitySize STANDING_DIMENSIONS = EntitySize.scalable(0.6F, 1.8F);
|
public static final EntitySize STANDING_DIMENSIONS = EntitySize.scalable(0.6F, 1.8F);
|
||||||
@ -30,7 +30,7 @@
|
|||||||
private static final int FLY_ACHIEVEMENT_SPEED = 25;
|
private static final int FLY_ACHIEVEMENT_SPEED = 25;
|
||||||
private static final DataWatcherObject<Float> DATA_PLAYER_ABSORPTION_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.FLOAT);
|
private static final DataWatcherObject<Float> DATA_PLAYER_ABSORPTION_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.FLOAT);
|
||||||
private static final DataWatcherObject<Integer> DATA_SCORE_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_SCORE_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.INT);
|
||||||
@@ -134,10 +148,10 @@
|
@@ -135,10 +149,10 @@
|
||||||
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
|
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
|
||||||
private long timeEntitySatOnShoulder;
|
private long timeEntitySatOnShoulder;
|
||||||
private final PlayerInventory inventory = new PlayerInventory(this);
|
private final PlayerInventory inventory = new PlayerInventory(this);
|
||||||
@ -43,7 +43,7 @@
|
|||||||
protected int jumpTriggerTime;
|
protected int jumpTriggerTime;
|
||||||
public float oBob;
|
public float oBob;
|
||||||
public float bob;
|
public float bob;
|
||||||
@@ -164,6 +178,16 @@
|
@@ -165,6 +179,16 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
public EntityFishingHook fishing;
|
public EntityFishingHook fishing;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@
|
|||||||
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
|
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
|
||||||
super(EntityTypes.PLAYER, world);
|
super(EntityTypes.PLAYER, world);
|
||||||
this.lastItemInMainHand = ItemStack.EMPTY;
|
this.lastItemInMainHand = ItemStack.EMPTY;
|
||||||
@@ -302,7 +326,7 @@
|
@@ -303,7 +327,7 @@
|
||||||
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
|
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
|
||||||
|
|
||||||
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
|
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
|
||||||
@ -69,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -494,7 +518,8 @@
|
@@ -495,7 +519,8 @@
|
||||||
|
|
||||||
if (this.level.getDifficulty() == EnumDifficulty.PEACEFUL && this.level.getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
|
if (this.level.getDifficulty() == EnumDifficulty.PEACEFUL && this.level.getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
|
||||||
if (this.getHealth() < this.getMaxHealth() && this.tickCount % 20 == 0) {
|
if (this.getHealth() < this.getMaxHealth() && this.tickCount % 20 == 0) {
|
||||||
@ -79,7 +79,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.foodData.needsFood() && this.tickCount % 10 == 0) {
|
if (this.foodData.needsFood() && this.tickCount % 10 == 0) {
|
||||||
@@ -682,6 +707,30 @@
|
@@ -692,6 +717,30 @@
|
||||||
entityitem.setDeltaMovement((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
|
entityitem.setDeltaMovement((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,12 +110,14 @@
|
|||||||
return entityitem;
|
return entityitem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,10 +863,10 @@
|
@@ -825,12 +874,12 @@
|
||||||
if (this.isDeadOrDying()) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
if (!this.level.isClientSide) {
|
||||||
- this.removeEntitiesOnShoulder();
|
- this.removeEntitiesOnShoulder();
|
||||||
+ // this.releaseShoulderEntities(); // CraftBukkit - moved down
|
+ // this.removeEntitiesOnShoulder(); // CraftBukkit - moved down
|
||||||
|
}
|
||||||
|
|
||||||
if (damagesource.scalesWithDifficulty()) {
|
if (damagesource.scalesWithDifficulty()) {
|
||||||
if (this.level.getDifficulty() == EnumDifficulty.PEACEFUL) {
|
if (this.level.getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||||
- f = 0.0F;
|
- f = 0.0F;
|
||||||
@ -123,7 +125,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
|
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
|
||||||
@@ -829,7 +878,13 @@
|
@@ -842,7 +891,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +140,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -849,10 +904,29 @@
|
@@ -862,10 +917,29 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canHarmPlayer(EntityHuman entityhuman) {
|
public boolean canHarmPlayer(EntityHuman entityhuman) {
|
||||||
@ -171,7 +173,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -894,8 +968,13 @@
|
@@ -907,8 +981,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +188,7 @@
|
|||||||
if (!this.isInvulnerableTo(damagesource)) {
|
if (!this.isInvulnerableTo(damagesource)) {
|
||||||
f = this.getDamageAfterArmorAbsorb(damagesource, f);
|
f = this.getDamageAfterArmorAbsorb(damagesource, f);
|
||||||
f = this.getDamageAfterMagicAbsorb(damagesource, f);
|
f = this.getDamageAfterMagicAbsorb(damagesource, f);
|
||||||
@@ -910,7 +989,7 @@
|
@@ -923,7 +1002,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f != 0.0F) {
|
if (f != 0.0F) {
|
||||||
@ -195,7 +197,7 @@
|
|||||||
float f3 = this.getHealth();
|
float f3 = this.getHealth();
|
||||||
|
|
||||||
this.setHealth(this.getHealth() - f);
|
this.setHealth(this.getHealth() - f);
|
||||||
@@ -921,6 +1000,7 @@
|
@@ -934,6 +1013,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +205,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1080,7 +1160,7 @@
|
@@ -1093,7 +1173,7 @@
|
||||||
|
|
||||||
f *= 0.2F + f2 * f2 * 0.8F;
|
f *= 0.2F + f2 * f2 * 0.8F;
|
||||||
f1 *= f2;
|
f1 *= f2;
|
||||||
@ -212,7 +214,7 @@
|
|||||||
if (f > 0.0F || f1 > 0.0F) {
|
if (f > 0.0F || f1 > 0.0F) {
|
||||||
boolean flag = f2 > 0.9F;
|
boolean flag = f2 > 0.9F;
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
@@ -1119,8 +1199,15 @@
|
@@ -1132,8 +1212,15 @@
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
f3 = ((EntityLiving) entity).getHealth();
|
f3 = ((EntityLiving) entity).getHealth();
|
||||||
if (j > 0 && !entity.isOnFire()) {
|
if (j > 0 && !entity.isOnFire()) {
|
||||||
@ -230,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,8 +1235,11 @@
|
@@ -1161,8 +1248,11 @@
|
||||||
EntityLiving entityliving = (EntityLiving) iterator.next();
|
EntityLiving entityliving = (EntityLiving) iterator.next();
|
||||||
|
|
||||||
if (entityliving != this && entityliving != entity && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
if (entityliving != this && entityliving != entity && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
||||||
@ -243,7 +245,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1158,9 +1248,26 @@
|
@@ -1171,9 +1261,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
||||||
@ -270,7 +272,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag2) {
|
if (flag2) {
|
||||||
@@ -1205,7 +1312,14 @@
|
@@ -1218,7 +1325,14 @@
|
||||||
|
|
||||||
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
@ -286,7 +288,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.level instanceof WorldServer && f5 > 2.0F) {
|
if (this.level instanceof WorldServer && f5 > 2.0F) {
|
||||||
@@ -1215,12 +1329,17 @@
|
@@ -1228,12 +1342,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +307,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1293,6 +1412,12 @@
|
@@ -1306,6 +1425,12 @@
|
||||||
public void updateTutorialInventoryAction(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
|
public void updateTutorialInventoryAction(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
|
||||||
|
|
||||||
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
|
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
|
||||||
@ -318,7 +320,7 @@
|
|||||||
this.startSleeping(blockposition);
|
this.startSleeping(blockposition);
|
||||||
this.sleepCounter = 0;
|
this.sleepCounter = 0;
|
||||||
return Either.right(Unit.INSTANCE);
|
return Either.right(Unit.INSTANCE);
|
||||||
@@ -1377,9 +1502,9 @@
|
@@ -1390,9 +1515,9 @@
|
||||||
super.jumpFromGround();
|
super.jumpFromGround();
|
||||||
this.awardStat(StatisticList.JUMP);
|
this.awardStat(StatisticList.JUMP);
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
@ -330,7 +332,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1413,7 +1538,11 @@
|
@@ -1426,7 +1551,11 @@
|
||||||
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
||||||
this.flyingSpeed = f;
|
this.flyingSpeed = f;
|
||||||
this.resetFallDistance();
|
this.resetFallDistance();
|
||||||
@ -343,7 +345,7 @@
|
|||||||
} else {
|
} else {
|
||||||
super.travel(vec3d);
|
super.travel(vec3d);
|
||||||
}
|
}
|
||||||
@@ -1448,19 +1577,19 @@
|
@@ -1461,19 +1590,19 @@
|
||||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
this.awardStat(StatisticList.SWIM_ONE_CM, i);
|
this.awardStat(StatisticList.SWIM_ONE_CM, i);
|
||||||
@ -366,7 +368,7 @@
|
|||||||
}
|
}
|
||||||
} else if (this.onClimbable()) {
|
} else if (this.onClimbable()) {
|
||||||
if (d1 > 0.0D) {
|
if (d1 > 0.0D) {
|
||||||
@@ -1471,13 +1600,13 @@
|
@@ -1484,13 +1613,13 @@
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
|
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
|
||||||
@ -383,7 +385,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.isFallFlying()) {
|
} else if (this.isFallFlying()) {
|
||||||
@@ -1543,12 +1672,24 @@
|
@@ -1556,12 +1685,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFallFlying() {
|
public void startFallFlying() {
|
||||||
@ -409,7 +411,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1638,10 +1779,21 @@
|
@@ -1651,10 +1792,21 @@
|
||||||
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +434,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1718,15 +1870,22 @@
|
@@ -1731,15 +1883,22 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||||
@ -458,7 +460,7 @@
|
|||||||
this.inventory.armor.set(enumitemslot.getIndex(), itemstack);
|
this.inventory.armor.set(enumitemslot.getIndex(), itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1767,26 +1926,31 @@
|
@@ -1780,26 +1939,31 @@
|
||||||
|
|
||||||
protected void removeEntitiesOnShoulder() {
|
protected void removeEntitiesOnShoulder() {
|
||||||
if (this.timeEntitySatOnShoulder + 20L < this.level.getGameTime()) {
|
if (this.timeEntitySatOnShoulder + 20L < this.level.getGameTime()) {
|
||||||
|
@ -44,10 +44,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.checkInsideBlocks();
|
this.checkInsideBlocks();
|
||||||
@@ -159,6 +175,11 @@
|
@@ -160,6 +176,11 @@
|
||||||
Entity entity = damagesource.getEntity();
|
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
|
if (!this.level.isClientSide) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
||||||
+ return false;
|
+ return false;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
public class EntityFireworks extends IProjectile implements ItemSupplier {
|
public class EntityFireworks extends IProjectile implements ItemSupplier {
|
||||||
|
|
||||||
public static final DataWatcherObject<ItemStack> DATA_ID_FIREWORKS_ITEM = DataWatcher.defineId(EntityFireworks.class, DataWatcherRegistry.ITEM_STACK);
|
public static final DataWatcherObject<ItemStack> DATA_ID_FIREWORKS_ITEM = DataWatcher.defineId(EntityFireworks.class, DataWatcherRegistry.ITEM_STACK);
|
||||||
@@ -141,7 +143,7 @@
|
@@ -144,7 +146,7 @@
|
||||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
||||||
|
|
||||||
if (!this.noPhysics) {
|
if (!this.noPhysics) {
|
||||||
@ -18,7 +18,7 @@
|
|||||||
this.hasImpulse = true;
|
this.hasImpulse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +158,11 @@
|
@@ -159,7 +161,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.isClientSide && this.life > this.lifetime) {
|
if (!this.level.isClientSide && this.life > this.lifetime) {
|
||||||
@ -31,7 +31,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -172,7 +178,11 @@
|
@@ -175,7 +181,11 @@
|
||||||
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {
|
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {
|
||||||
super.onHitEntity(movingobjectpositionentity);
|
super.onHitEntity(movingobjectpositionentity);
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +192,11 @@
|
@@ -185,7 +195,11 @@
|
||||||
|
|
||||||
this.level.getBlockState(blockposition).entityInside(this.level, blockposition, this);
|
this.level.getBlockState(blockposition).entityInside(this.level, blockposition, this);
|
||||||
if (!this.level.isClientSide() && this.hasExplosion()) {
|
if (!this.level.isClientSide() && this.hasExplosion()) {
|
||||||
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
super.onHitBlock(movingobjectpositionblock);
|
super.onHitBlock(movingobjectpositionblock);
|
||||||
@@ -208,7 +222,9 @@
|
@@ -211,7 +225,9 @@
|
||||||
|
|
||||||
if (f > 0.0F) {
|
if (f > 0.0F) {
|
||||||
if (this.attachedToEntity != null) {
|
if (this.attachedToEntity != null) {
|
||||||
@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
double d0 = 5.0D;
|
double d0 = 5.0D;
|
||||||
@@ -235,7 +251,9 @@
|
@@ -238,7 +254,9 @@
|
||||||
if (flag) {
|
if (flag) {
|
||||||
float f1 = f * (float) Math.sqrt((5.0D - (double) this.distanceTo(entityliving)) / 5.0D);
|
float f1 = f * (float) Math.sqrt((5.0D - (double) this.distanceTo(entityliving)) / 5.0D);
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
--- a/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
+++ b/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
||||||
@@ -44,6 +44,12 @@
|
@@ -45,6 +45,12 @@
|
||||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.entity.Player;
|
+import org.bukkit.entity.Player;
|
||||||
@ -12,8 +12,8 @@
|
|||||||
+
|
+
|
||||||
public class EntityFishingHook extends IProjectile {
|
public class EntityFishingHook extends IProjectile {
|
||||||
|
|
||||||
private final Random syncronizedRandom;
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -64,6 +70,12 @@
|
@@ -66,6 +72,12 @@
|
||||||
private final int luck;
|
private final int luck;
|
||||||
private final int lureSpeed;
|
private final int lureSpeed;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
private EntityFishingHook(EntityTypes<? extends EntityFishingHook> entitytypes, World world, int i, int j) {
|
private EntityFishingHook(EntityTypes<? extends EntityFishingHook> entitytypes, World world, int i, int j) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.syncronizedRandom = new Random();
|
this.syncronizedRandom = new Random();
|
||||||
@@ -258,7 +270,7 @@
|
@@ -260,7 +272,7 @@
|
||||||
private void checkCollision() {
|
private void checkCollision() {
|
||||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -305,6 +317,10 @@
|
@@ -307,6 +319,10 @@
|
||||||
this.timeUntilLured = 0;
|
this.timeUntilLured = 0;
|
||||||
this.timeUntilHooked = 0;
|
this.timeUntilHooked = 0;
|
||||||
this.getEntityData().set(EntityFishingHook.DATA_BITING, false);
|
this.getEntityData().set(EntityFishingHook.DATA_BITING, false);
|
||||||
@ -46,7 +46,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float f;
|
float f;
|
||||||
@@ -338,6 +354,13 @@
|
@@ -340,6 +356,13 @@
|
||||||
worldserver.sendParticles(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
|
worldserver.sendParticles(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -60,7 +60,7 @@
|
|||||||
this.playSound(SoundEffects.FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
this.playSound(SoundEffects.FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||||
double d3 = this.getY() + 0.5D;
|
double d3 = this.getY() + 0.5D;
|
||||||
|
|
||||||
@@ -374,8 +397,10 @@
|
@@ -376,8 +399,10 @@
|
||||||
this.timeUntilHooked = MathHelper.nextInt(this.random, 20, 80);
|
this.timeUntilHooked = MathHelper.nextInt(this.random, 20, 80);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -73,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,6 +467,14 @@
|
@@ -444,6 +469,14 @@
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if (this.hookedIn != null) {
|
if (this.hookedIn != null) {
|
||||||
@ -88,7 +88,7 @@
|
|||||||
this.pullEntity(this.hookedIn);
|
this.pullEntity(this.hookedIn);
|
||||||
CriterionTriggers.FISHING_ROD_HOOKED.trigger((EntityPlayer) entityhuman, itemstack, this, Collections.emptyList());
|
CriterionTriggers.FISHING_ROD_HOOKED.trigger((EntityPlayer) entityhuman, itemstack, this, Collections.emptyList());
|
||||||
this.level.broadcastEntityEvent(this, (byte) 31);
|
this.level.broadcastEntityEvent(this, (byte) 31);
|
||||||
@@ -457,6 +490,15 @@
|
@@ -459,6 +492,15 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ItemStack itemstack1 = (ItemStack) iterator.next();
|
ItemStack itemstack1 = (ItemStack) iterator.next();
|
||||||
EntityItem entityitem = new EntityItem(this.level, this.getX(), this.getY(), this.getZ(), itemstack1);
|
EntityItem entityitem = new EntityItem(this.level, this.getX(), this.getY(), this.getZ(), itemstack1);
|
||||||
@ -104,7 +104,7 @@
|
|||||||
double d0 = entityhuman.getX() - this.getX();
|
double d0 = entityhuman.getX() - this.getX();
|
||||||
double d1 = entityhuman.getY() - this.getY();
|
double d1 = entityhuman.getY() - this.getY();
|
||||||
double d2 = entityhuman.getZ() - this.getZ();
|
double d2 = entityhuman.getZ() - this.getZ();
|
||||||
@@ -464,7 +506,11 @@
|
@@ -466,7 +508,11 @@
|
||||||
|
|
||||||
entityitem.setDeltaMovement(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
|
entityitem.setDeltaMovement(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
|
||||||
this.level.addFreshEntity(entityitem);
|
this.level.addFreshEntity(entityitem);
|
||||||
@ -114,10 +114,10 @@
|
|||||||
+ entityhuman.level.addFreshEntity(new EntityExperienceOrb(entityhuman.level, entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop()));
|
+ entityhuman.level.addFreshEntity(new EntityExperienceOrb(entityhuman.level, entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop()));
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
if (itemstack1.is((Tag) TagsItem.FISHES)) {
|
if (itemstack1.is(TagsItem.FISHES)) {
|
||||||
entityhuman.awardStat(StatisticList.FISH_CAUGHT, 1);
|
entityhuman.awardStat(StatisticList.FISH_CAUGHT, 1);
|
||||||
}
|
}
|
||||||
@@ -474,8 +520,25 @@
|
@@ -476,8 +522,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround) {
|
if (this.onGround) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/projectile/EntityPotion.java
|
--- a/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/EntityPotion.java
|
+++ b/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||||
@@ -33,6 +33,16 @@
|
@@ -32,6 +32,16 @@
|
||||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||||
|
|
||||||
@ -17,7 +17,7 @@
|
|||||||
public class EntityPotion extends EntityProjectileThrowable implements ItemSupplier {
|
public class EntityPotion extends EntityProjectileThrowable implements ItemSupplier {
|
||||||
|
|
||||||
public static final double SPLASH_RANGE = 4.0D;
|
public static final double SPLASH_RANGE = 4.0D;
|
||||||
@@ -99,7 +109,7 @@
|
@@ -98,7 +108,7 @@
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.applyWater();
|
this.applyWater();
|
||||||
@ -26,7 +26,7 @@
|
|||||||
if (this.isLingering()) {
|
if (this.isLingering()) {
|
||||||
this.makeAreaOfEffectCloud(itemstack, potionregistry);
|
this.makeAreaOfEffectCloud(itemstack, potionregistry);
|
||||||
} else {
|
} else {
|
||||||
@@ -145,6 +155,7 @@
|
@@ -144,6 +154,7 @@
|
||||||
private void applySplash(List<MobEffect> list, @Nullable Entity entity) {
|
private void applySplash(List<MobEffect> list, @Nullable Entity entity) {
|
||||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
|
AxisAlignedBB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
|
||||||
List<EntityLiving> list1 = this.level.getEntitiesOfClass(EntityLiving.class, axisalignedbb);
|
List<EntityLiving> list1 = this.level.getEntitiesOfClass(EntityLiving.class, axisalignedbb);
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
if (!list1.isEmpty()) {
|
if (!list1.isEmpty()) {
|
||||||
Entity entity1 = this.getEffectSource();
|
Entity entity1 = this.getEffectSource();
|
||||||
@@ -163,21 +174,47 @@
|
@@ -162,21 +173,47 @@
|
||||||
d1 = 1.0D;
|
d1 = 1.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,7 +250,14 @@
|
@@ -212,7 +249,14 @@
|
||||||
entityareaeffectcloud.setFixedColor(nbttagcompound.getInt("CustomPotionColor"));
|
entityareaeffectcloud.setFixedColor(nbttagcompound.getInt("CustomPotionColor"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,10 +112,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLingering() {
|
public boolean isLingering() {
|
||||||
@@ -224,13 +268,25 @@
|
@@ -223,13 +267,25 @@
|
||||||
IBlockData iblockdata = this.level.getBlockState(blockposition);
|
IBlockData iblockdata = this.level.getBlockState(blockposition);
|
||||||
|
|
||||||
if (iblockdata.is((Tag) TagsBlock.FIRE)) {
|
if (iblockdata.is(TagsBlock.FIRE)) {
|
||||||
- this.level.removeBlock(blockposition, false);
|
- this.level.removeBlock(blockposition, false);
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
+++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||||
@@ -60,8 +60,21 @@
|
@@ -59,8 +59,21 @@
|
||||||
this.finalTarget = entity;
|
this.finalTarget = entity;
|
||||||
this.currentMoveDirection = EnumDirection.UP;
|
this.currentMoveDirection = EnumDirection.UP;
|
||||||
this.selectNextMoveDirection(enumdirection_enumaxis);
|
this.selectNextMoveDirection(enumdirection_enumaxis);
|
||||||
@ -22,7 +22,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public SoundCategory getSoundSource() {
|
public SoundCategory getSoundSource() {
|
||||||
return SoundCategory.HOSTILE;
|
return SoundCategory.HOSTILE;
|
||||||
@@ -225,7 +238,7 @@
|
@@ -224,7 +237,7 @@
|
||||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResult(this, this::canHitEntity);
|
||||||
|
|
||||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||||
@ -31,7 +31,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +305,7 @@
|
@@ -291,7 +304,7 @@
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.doEnchantDamageEffects(entityliving, entity);
|
this.doEnchantDamageEffects(entityliving, entity);
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,6 +331,11 @@
|
@@ -317,6 +330,11 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hurt(DamageSource damagesource, float f) {
|
public boolean hurt(DamageSource damagesource, float f) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/raid/EntityRaider.java
|
--- a/net/minecraft/world/entity/raid/EntityRaider.java
|
||||||
+++ b/net/minecraft/world/entity/raid/EntityRaider.java
|
+++ b/net/minecraft/world/entity/raid/EntityRaider.java
|
||||||
@@ -166,7 +166,7 @@
|
@@ -165,7 +165,7 @@
|
||||||
MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true);
|
MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true);
|
||||||
|
|
||||||
if (!this.level.getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) {
|
if (!this.level.getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@
|
@@ -305,7 +305,7 @@
|
||||||
|
|
||||||
private final T mob;
|
private final T mob;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
this.mob = entityraider;
|
this.mob = entityraider;
|
||||||
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
|
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||||
}
|
}
|
||||||
@@ -522,7 +522,7 @@
|
@@ -521,7 +521,7 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
EntityRaider entityraider = (EntityRaider) iterator.next();
|
EntityRaider entityraider = (EntityRaider) iterator.next();
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@
|
@@ -538,7 +538,7 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
EntityRaider entityraider = (EntityRaider) iterator.next();
|
EntityRaider entityraider = (EntityRaider) iterator.next();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/raid/PersistentRaid.java
|
--- a/net/minecraft/world/entity/raid/PersistentRaid.java
|
||||||
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
|
+++ b/net/minecraft/world/entity/raid/PersistentRaid.java
|
||||||
@@ -109,19 +109,33 @@
|
@@ -110,19 +110,33 @@
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
|
|
||||||
if (!raid.isStarted()) {
|
if (!raid.isStarted()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/vehicle/EntityBoat.java
|
--- a/net/minecraft/world/entity/vehicle/EntityBoat.java
|
||||||
+++ b/net/minecraft/world/entity/vehicle/EntityBoat.java
|
+++ b/net/minecraft/world/entity/vehicle/EntityBoat.java
|
||||||
@@ -52,6 +52,15 @@
|
@@ -51,6 +51,15 @@
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
public class EntityBoat extends Entity {
|
public class EntityBoat extends Entity {
|
||||||
|
|
||||||
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityBoat.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityBoat.class, DataWatcherRegistry.INT);
|
||||||
@@ -92,6 +101,14 @@
|
@@ -91,6 +100,14 @@
|
||||||
private float bubbleAngle;
|
private float bubbleAngle;
|
||||||
private float bubbleAngleO;
|
private float bubbleAngleO;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@
|
|||||||
public EntityBoat(EntityTypes<? extends EntityBoat> entitytypes, World world) {
|
public EntityBoat(EntityTypes<? extends EntityBoat> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.paddlePositions = new float[2];
|
this.paddlePositions = new float[2];
|
||||||
@@ -161,6 +178,19 @@
|
@@ -160,6 +177,19 @@
|
||||||
if (this.isInvulnerableTo(damagesource)) {
|
if (this.isInvulnerableTo(damagesource)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!this.level.isClientSide && !this.isRemoved()) {
|
} else if (!this.level.isClientSide && !this.isRemoved()) {
|
||||||
@ -51,7 +51,7 @@
|
|||||||
this.setHurtDir(-this.getHurtDir());
|
this.setHurtDir(-this.getHurtDir());
|
||||||
this.setHurtTime(10);
|
this.setHurtTime(10);
|
||||||
this.setDamage(this.getDamage() + f * 10.0F);
|
this.setDamage(this.getDamage() + f * 10.0F);
|
||||||
@@ -169,6 +199,15 @@
|
@@ -168,6 +198,15 @@
|
||||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
||||||
|
|
||||||
if (flag || this.getDamage() > 40.0F) {
|
if (flag || this.getDamage() > 40.0F) {
|
||||||
@ -67,7 +67,7 @@
|
|||||||
if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||||
this.spawnAtLocation((IMaterial) this.getDropItem());
|
this.spawnAtLocation((IMaterial) this.getDropItem());
|
||||||
}
|
}
|
||||||
@@ -204,9 +243,29 @@
|
@@ -203,9 +242,29 @@
|
||||||
public void push(Entity entity) {
|
public void push(Entity entity) {
|
||||||
if (entity instanceof EntityBoat) {
|
if (entity instanceof EntityBoat) {
|
||||||
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
|
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
|
||||||
@ -97,7 +97,7 @@
|
|||||||
super.push(entity);
|
super.push(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,6 +316,7 @@
|
@@ -256,6 +315,7 @@
|
||||||
return this.getDirection().getClockWise();
|
return this.getDirection().getClockWise();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +105,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
this.oldStatus = this.status;
|
this.oldStatus = this.status;
|
||||||
@@ -297,6 +357,22 @@
|
@@ -296,6 +356,22 @@
|
||||||
this.setDeltaMovement(Vec3D.ZERO);
|
this.setDeltaMovement(Vec3D.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +128,7 @@
|
|||||||
this.tickBubbleColumn();
|
this.tickBubbleColumn();
|
||||||
|
|
||||||
for (int i = 0; i <= 1; ++i) {
|
for (int i = 0; i <= 1; ++i) {
|
||||||
@@ -801,6 +877,11 @@
|
@@ -800,6 +876,11 @@
|
||||||
|
|
||||||
this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
|
this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
|
||||||
if (!this.level.isClientSide && !this.isRemoved()) {
|
if (!this.level.isClientSide && !this.isRemoved()) {
|
||||||
@ -140,7 +140,7 @@
|
|||||||
this.kill();
|
this.kill();
|
||||||
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||||
int i;
|
int i;
|
||||||
@@ -814,6 +895,7 @@
|
@@ -813,6 +894,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||||
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||||
@@ -49,6 +49,15 @@
|
@@ -48,6 +48,15 @@
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
public abstract class EntityMinecartAbstract extends Entity {
|
public abstract class EntityMinecartAbstract extends Entity {
|
||||||
|
|
||||||
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityMinecartAbstract.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityMinecartAbstract.class, DataWatcherRegistry.INT);
|
||||||
@@ -91,6 +100,17 @@
|
@@ -90,6 +99,17 @@
|
||||||
private double lyd;
|
private double lyd;
|
||||||
private double lzd;
|
private double lzd;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
|
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.blocksBuilding = true;
|
this.blocksBuilding = true;
|
||||||
@@ -217,6 +237,19 @@
|
@@ -216,6 +236,19 @@
|
||||||
if (this.isInvulnerableTo(damagesource)) {
|
if (this.isInvulnerableTo(damagesource)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -54,7 +54,7 @@
|
|||||||
this.setHurtDir(-this.getHurtDir());
|
this.setHurtDir(-this.getHurtDir());
|
||||||
this.setHurtTime(10);
|
this.setHurtTime(10);
|
||||||
this.markHurt();
|
this.markHurt();
|
||||||
@@ -225,6 +258,15 @@
|
@@ -224,6 +257,15 @@
|
||||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
||||||
|
|
||||||
if (flag || this.getDamage() > 40.0F) {
|
if (flag || this.getDamage() > 40.0F) {
|
||||||
@ -70,7 +70,7 @@
|
|||||||
this.ejectPassengers();
|
this.ejectPassengers();
|
||||||
if (flag && !this.hasCustomName()) {
|
if (flag && !this.hasCustomName()) {
|
||||||
this.discard();
|
this.discard();
|
||||||
@@ -284,6 +326,14 @@
|
@@ -283,6 +325,14 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@ -85,7 +85,7 @@
|
|||||||
if (this.getHurtTime() > 0) {
|
if (this.getHurtTime() > 0) {
|
||||||
this.setHurtTime(this.getHurtTime() - 1);
|
this.setHurtTime(this.getHurtTime() - 1);
|
||||||
}
|
}
|
||||||
@@ -293,7 +343,7 @@
|
@@ -292,7 +342,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.checkOutOfWorld();
|
this.checkOutOfWorld();
|
||||||
@ -94,7 +94,7 @@
|
|||||||
double d0;
|
double d0;
|
||||||
|
|
||||||
if (this.level.isClientSide) {
|
if (this.level.isClientSide) {
|
||||||
@@ -359,6 +409,18 @@
|
@@ -358,6 +408,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setRot(this.getYRot(), this.getXRot());
|
this.setRot(this.getYRot(), this.getXRot());
|
||||||
@ -113,7 +113,7 @@
|
|||||||
if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
|
||||||
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.pushableBy(this));
|
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.pushableBy(this));
|
||||||
|
|
||||||
@@ -367,8 +429,26 @@
|
@@ -366,8 +428,26 @@
|
||||||
Entity entity = (Entity) list.get(l);
|
Entity entity = (Entity) list.get(l);
|
||||||
|
|
||||||
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
|
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
|
||||||
@ -140,7 +140,7 @@
|
|||||||
entity.push(this);
|
entity.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,6 +460,14 @@
|
@@ -379,6 +459,14 @@
|
||||||
Entity entity1 = (Entity) iterator.next();
|
Entity entity1 = (Entity) iterator.next();
|
||||||
|
|
||||||
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
|
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
|
||||||
@ -155,7 +155,7 @@
|
|||||||
entity1.push(this);
|
entity1.push(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -396,7 +484,7 @@
|
@@ -395,7 +483,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected double getMaxSpeed() {
|
protected double getMaxSpeed() {
|
||||||
@ -164,7 +164,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void activateMinecart(int i, int j, int k, boolean flag) {}
|
public void activateMinecart(int i, int j, int k, boolean flag) {}
|
||||||
@@ -407,12 +495,16 @@
|
@@ -406,12 +494,16 @@
|
||||||
|
|
||||||
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
|
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
|
||||||
if (this.onGround) {
|
if (this.onGround) {
|
||||||
@ -183,7 +183,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -603,7 +695,7 @@
|
@@ -602,7 +694,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void applyNaturalSlowdown() {
|
protected void applyNaturalSlowdown() {
|
||||||
@ -192,7 +192,7 @@
|
|||||||
Vec3D vec3d = this.getDeltaMovement();
|
Vec3D vec3d = this.getDeltaMovement();
|
||||||
|
|
||||||
vec3d = vec3d.multiply(d0, 0.0D, d0);
|
vec3d = vec3d.multiply(d0, 0.0D, d0);
|
||||||
@@ -742,6 +834,14 @@
|
@@ -741,6 +833,14 @@
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
if (!entity.noPhysics && !this.noPhysics) {
|
if (!entity.noPhysics && !this.noPhysics) {
|
||||||
if (!this.hasPassenger(entity)) {
|
if (!this.hasPassenger(entity)) {
|
||||||
@ -207,7 +207,7 @@
|
|||||||
double d0 = entity.getX() - this.getX();
|
double d0 = entity.getX() - this.getX();
|
||||||
double d1 = entity.getZ() - this.getZ();
|
double d1 = entity.getZ() - this.getZ();
|
||||||
double d2 = d0 * d0 + d1 * d1;
|
double d2 = d0 * d0 + d1 * d1;
|
||||||
@@ -921,4 +1021,26 @@
|
@@ -920,4 +1020,26 @@
|
||||||
|
|
||||||
private EnumMinecartType() {}
|
private EnumMinecartType() {}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/inventory/Container.java
|
--- a/net/minecraft/world/inventory/Container.java
|
||||||
+++ b/net/minecraft/world/inventory/Container.java
|
+++ b/net/minecraft/world/inventory/Container.java
|
||||||
@@ -30,6 +30,20 @@
|
@@ -32,6 +32,20 @@
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import net.minecraft.world.level.block.entity.TileEntity;
|
import net.minecraft.world.level.block.entity.TileEntity;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import com.google.common.base.Preconditions;
|
+import com.google.common.base.Preconditions;
|
||||||
@ -20,8 +20,8 @@
|
|||||||
+
|
+
|
||||||
public abstract class Container {
|
public abstract class Container {
|
||||||
|
|
||||||
public static final int SLOT_CLICKED_OUTSIDE = -999;
|
private static Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -59,6 +73,27 @@
|
@@ -62,6 +76,27 @@
|
||||||
private ContainerSynchronizer synchronizer;
|
private ContainerSynchronizer synchronizer;
|
||||||
private boolean suppressRemoteUpdates;
|
private boolean suppressRemoteUpdates;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@
|
|||||||
protected Container(@Nullable Containers<?> containers, int i) {
|
protected Container(@Nullable Containers<?> containers, int i) {
|
||||||
this.carried = ItemStack.EMPTY;
|
this.carried = ItemStack.EMPTY;
|
||||||
this.remoteSlots = NonNullList.create();
|
this.remoteSlots = NonNullList.create();
|
||||||
@@ -156,6 +191,15 @@
|
@@ -163,6 +198,15 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@
|
|||||||
public void removeSlotListener(ICrafting icrafting) {
|
public void removeSlotListener(ICrafting icrafting) {
|
||||||
this.containerListeners.remove(icrafting);
|
this.containerListeners.remove(icrafting);
|
||||||
}
|
}
|
||||||
@@ -370,7 +414,7 @@
|
@@ -381,7 +425,7 @@
|
||||||
}
|
}
|
||||||
} else if (this.quickcraftStatus == 2) {
|
} else if (this.quickcraftStatus == 2) {
|
||||||
if (!this.quickcraftSlots.isEmpty()) {
|
if (!this.quickcraftSlots.isEmpty()) {
|
||||||
@ -74,7 +74,7 @@
|
|||||||
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
|
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
|
||||||
this.resetQuickCraft();
|
this.resetQuickCraft();
|
||||||
this.doClick(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
|
this.doClick(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
|
||||||
@@ -381,6 +425,7 @@
|
@@ -392,6 +436,7 @@
|
||||||
l = this.getCarried().getCount();
|
l = this.getCarried().getCount();
|
||||||
Iterator iterator = this.quickcraftSlots.iterator();
|
Iterator iterator = this.quickcraftSlots.iterator();
|
||||||
|
|
||||||
@ -82,7 +82,7 @@
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Slot slot1 = (Slot) iterator.next();
|
Slot slot1 = (Slot) iterator.next();
|
||||||
ItemStack itemstack2 = this.getCarried();
|
ItemStack itemstack2 = this.getCarried();
|
||||||
@@ -397,12 +442,48 @@
|
@@ -408,12 +453,48 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
l -= itemstack3.getCount() - j1;
|
l -= itemstack3.getCount() - j1;
|
||||||
@ -134,7 +134,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.resetQuickCraft();
|
this.resetQuickCraft();
|
||||||
@@ -420,8 +501,11 @@
|
@@ -431,8 +512,11 @@
|
||||||
if (i == -999) {
|
if (i == -999) {
|
||||||
if (!this.getCarried().isEmpty()) {
|
if (!this.getCarried().isEmpty()) {
|
||||||
if (clickaction == ClickAction.PRIMARY) {
|
if (clickaction == ClickAction.PRIMARY) {
|
||||||
@ -147,7 +147,7 @@
|
|||||||
} else {
|
} else {
|
||||||
entityhuman.drop(this.getCarried().split(1), true);
|
entityhuman.drop(this.getCarried().split(1), true);
|
||||||
}
|
}
|
||||||
@@ -484,6 +568,15 @@
|
@@ -495,6 +579,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.setChanged();
|
slot.setChanged();
|
||||||
@ -163,7 +163,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Slot slot2;
|
Slot slot2;
|
||||||
@@ -591,13 +684,14 @@
|
@@ -602,13 +695,14 @@
|
||||||
ItemStack itemstack = this.getCarried();
|
ItemStack itemstack = this.getCarried();
|
||||||
|
|
||||||
if (!itemstack.isEmpty()) {
|
if (!itemstack.isEmpty()) {
|
||||||
@ -179,7 +179,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,6 +905,11 @@
|
@@ -822,6 +916,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getCarried() {
|
public ItemStack getCarried() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/inventory/ContainerAnvil.java
|
--- a/net/minecraft/world/inventory/ContainerAnvil.java
|
||||||
+++ b/net/minecraft/world/inventory/ContainerAnvil.java
|
+++ b/net/minecraft/world/inventory/ContainerAnvil.java
|
||||||
@@ -18,12 +18,16 @@
|
@@ -17,12 +17,16 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||||
@ -10,7 +10,7 @@
|
|||||||
+
|
+
|
||||||
public class ContainerAnvil extends ContainerAnvilAbstract {
|
public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
private static final boolean DEBUG_COST = false;
|
private static final boolean DEBUG_COST = false;
|
||||||
public static final int MAX_NAME_LENGTH = 50;
|
public static final int MAX_NAME_LENGTH = 50;
|
||||||
- private int repairItemCountCost;
|
- private int repairItemCountCost;
|
||||||
@ -18,7 +18,7 @@
|
|||||||
public String itemName;
|
public String itemName;
|
||||||
public final ContainerProperty cost;
|
public final ContainerProperty cost;
|
||||||
private static final int COST_FAIL = 0;
|
private static final int COST_FAIL = 0;
|
||||||
@@ -33,6 +37,10 @@
|
@@ -32,6 +36,10 @@
|
||||||
private static final int COST_REPAIR_SACRIFICE = 2;
|
private static final int COST_REPAIR_SACRIFICE = 2;
|
||||||
private static final int COST_INCOMPATIBLE_PENALTY = 1;
|
private static final int COST_INCOMPATIBLE_PENALTY = 1;
|
||||||
private static final int COST_RENAME = 1;
|
private static final int COST_RENAME = 1;
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||||
this(i, playerinventory, ContainerAccess.NULL);
|
this(i, playerinventory, ContainerAccess.NULL);
|
||||||
@@ -105,7 +113,7 @@
|
@@ -104,7 +112,7 @@
|
||||||
byte b1 = 0;
|
byte b1 = 0;
|
||||||
|
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
@ -38,7 +38,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
} else {
|
} else {
|
||||||
ItemStack itemstack1 = itemstack.copy();
|
ItemStack itemstack1 = itemstack.copy();
|
||||||
@@ -123,7 +131,7 @@
|
@@ -122,7 +130,7 @@
|
||||||
if (itemstack1.isDamageableItem() && itemstack1.getItem().isValidRepairItem(itemstack, itemstack2)) {
|
if (itemstack1.isDamageableItem() && itemstack1.getItem().isValidRepairItem(itemstack, itemstack2)) {
|
||||||
k = Math.min(itemstack1.getDamageValue(), itemstack1.getMaxDamage() / 4);
|
k = Math.min(itemstack1.getDamageValue(), itemstack1.getMaxDamage() / 4);
|
||||||
if (k <= 0) {
|
if (k <= 0) {
|
||||||
@ -47,7 +47,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -138,7 +146,7 @@
|
@@ -137,7 +145,7 @@
|
||||||
this.repairItemCountCost = i1;
|
this.repairItemCountCost = i1;
|
||||||
} else {
|
} else {
|
||||||
if (!flag && (!itemstack1.is(itemstack2.getItem()) || !itemstack1.isDamageableItem())) {
|
if (!flag && (!itemstack1.is(itemstack2.getItem()) || !itemstack1.isDamageableItem())) {
|
||||||
@ -56,7 +56,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -228,7 +236,7 @@
|
@@ -227,7 +235,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag2 && !flag1) {
|
if (flag2 && !flag1) {
|
||||||
@ -65,7 +65,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -252,11 +260,11 @@
|
@@ -251,11 +259,11 @@
|
||||||
itemstack1 = ItemStack.EMPTY;
|
itemstack1 = ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@
|
|||||||
itemstack1 = ItemStack.EMPTY;
|
itemstack1 = ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +283,8 @@
|
@@ -274,7 +282,8 @@
|
||||||
EnchantmentManager.setEnchantments(map, itemstack1);
|
EnchantmentManager.setEnchantments(map, itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,7 @@
|
|||||||
this.broadcastChanges();
|
this.broadcastChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,4 +311,18 @@
|
@@ -301,4 +310,18 @@
|
||||||
public int getCost() {
|
public int getCost() {
|
||||||
return this.cost.get();
|
return this.cost.get();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/inventory/ContainerBeacon.java
|
--- a/net/minecraft/world/inventory/ContainerBeacon.java
|
||||||
+++ b/net/minecraft/world/inventory/ContainerBeacon.java
|
+++ b/net/minecraft/world/inventory/ContainerBeacon.java
|
||||||
@@ -11,6 +11,11 @@
|
@@ -10,6 +10,11 @@
|
||||||
import net.minecraft.world.level.World;
|
import net.minecraft.world.level.World;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class ContainerBeacon extends Container {
|
public class ContainerBeacon extends Container {
|
||||||
|
|
||||||
private static final int PAYMENT_SLOT = 0;
|
private static final int PAYMENT_SLOT = 0;
|
||||||
@@ -24,6 +29,10 @@
|
@@ -23,6 +28,10 @@
|
||||||
private final ContainerBeacon.SlotBeacon paymentSlot;
|
private final ContainerBeacon.SlotBeacon paymentSlot;
|
||||||
private final ContainerAccess access;
|
private final ContainerAccess access;
|
||||||
private final IContainerProperties beaconData;
|
private final IContainerProperties beaconData;
|
||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
public ContainerBeacon(int i, IInventory iinventory) {
|
public ContainerBeacon(int i, IInventory iinventory) {
|
||||||
this(i, iinventory, new ContainerProperties(3), ContainerAccess.NULL);
|
this(i, iinventory, new ContainerProperties(3), ContainerAccess.NULL);
|
||||||
@@ -31,6 +40,7 @@
|
@@ -30,6 +39,7 @@
|
||||||
|
|
||||||
public ContainerBeacon(int i, IInventory iinventory, IContainerProperties icontainerproperties, ContainerAccess containeraccess) {
|
public ContainerBeacon(int i, IInventory iinventory, IContainerProperties icontainerproperties, ContainerAccess containeraccess) {
|
||||||
super(Containers.BEACON, i);
|
super(Containers.BEACON, i);
|
||||||
@ -31,7 +31,7 @@
|
|||||||
this.beacon = new InventorySubcontainer(1) {
|
this.beacon = new InventorySubcontainer(1) {
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceItem(int j, ItemStack itemstack) {
|
public boolean canPlaceItem(int j, ItemStack itemstack) {
|
||||||
@@ -80,6 +90,7 @@
|
@@ -79,6 +89,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean stillValid(EntityHuman entityhuman) {
|
public boolean stillValid(EntityHuman entityhuman) {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
return stillValid(this.access, entityhuman, Blocks.BEACON);
|
return stillValid(this.access, entityhuman, Blocks.BEACON);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,4 +191,17 @@
|
@@ -179,4 +190,17 @@
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--- a/net/minecraft/world/inventory/ContainerEnchantTable.java
|
--- a/net/minecraft/world/inventory/ContainerEnchantTable.java
|
||||||
+++ b/net/minecraft/world/inventory/ContainerEnchantTable.java
|
+++ b/net/minecraft/world/inventory/ContainerEnchantTable.java
|
||||||
@@ -20,6 +20,21 @@
|
@@ -25,6 +25,21 @@
|
||||||
import net.minecraft.world.item.enchantment.WeightedRandomEnchant;
|
import net.minecraft.world.level.block.BlockEnchantmentTable;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
@ -22,7 +22,7 @@
|
|||||||
public class ContainerEnchantTable extends Container {
|
public class ContainerEnchantTable extends Container {
|
||||||
|
|
||||||
private final IInventory enchantSlots;
|
private final IInventory enchantSlots;
|
||||||
@@ -29,6 +44,10 @@
|
@@ -34,6 +49,10 @@
|
||||||
public final int[] costs;
|
public final int[] costs;
|
||||||
public final int[] enchantClue;
|
public final int[] enchantClue;
|
||||||
public final int[] levelClue;
|
public final int[] levelClue;
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
|
public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
|
||||||
this(i, playerinventory, ContainerAccess.NULL);
|
this(i, playerinventory, ContainerAccess.NULL);
|
||||||
@@ -42,6 +61,13 @@
|
@@ -47,6 +66,13 @@
|
||||||
super.setChanged();
|
super.setChanged();
|
||||||
ContainerEnchantTable.this.slotsChanged(this);
|
ContainerEnchantTable.this.slotsChanged(this);
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@
|
|||||||
};
|
};
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
this.enchantmentSeed = ContainerProperty.standalone();
|
this.enchantmentSeed = ContainerProperty.standalone();
|
||||||
@@ -89,6 +115,9 @@
|
@@ -94,6 +120,9 @@
|
||||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 0));
|
this.addDataSlot(ContainerProperty.shared(this.levelClue, 0));
|
||||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 1));
|
this.addDataSlot(ContainerProperty.shared(this.levelClue, 1));
|
||||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 2));
|
this.addDataSlot(ContainerProperty.shared(this.levelClue, 2));
|
||||||
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,7 +125,7 @@
|
@@ -101,7 +130,7 @@
|
||||||
if (iinventory == this.enchantSlots) {
|
if (iinventory == this.enchantSlots) {
|
||||||
ItemStack itemstack = iinventory.getItem(0);
|
ItemStack itemstack = iinventory.getItem(0);
|
||||||
|
|
||||||
@ -65,8 +65,8 @@
|
|||||||
+ if (!itemstack.isEmpty()) { // CraftBukkit - relax condition
|
+ if (!itemstack.isEmpty()) { // CraftBukkit - relax condition
|
||||||
this.access.execute((world, blockposition) -> {
|
this.access.execute((world, blockposition) -> {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
Iterator iterator = BlockEnchantmentTable.BOOKSHELF_OFFSETS.iterator();
|
||||||
@@ -158,6 +187,41 @@
|
@@ -140,6 +169,41 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@
|
|||||||
this.broadcastChanges();
|
this.broadcastChanges();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -184,9 +248,24 @@
|
@@ -167,9 +231,24 @@
|
||||||
ItemStack itemstack2 = itemstack;
|
ItemStack itemstack2 = itemstack;
|
||||||
List<WeightedRandomEnchant> list = this.getEnchantmentList(itemstack, i, this.costs[i]);
|
List<WeightedRandomEnchant> list = this.getEnchantmentList(itemstack, i, this.costs[i]);
|
||||||
|
|
||||||
@ -135,12 +135,17 @@
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
|
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
|
||||||
@@ -199,16 +278,29 @@
|
@@ -182,16 +261,29 @@
|
||||||
this.enchantSlots.setItem(0, itemstack2);
|
this.enchantSlots.setItem(0, itemstack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
- for (int k = 0; k < list.size(); ++k) {
|
- for (int k = 0; k < list.size(); ++k) {
|
||||||
- WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(k);
|
- WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(k);
|
||||||
|
-
|
||||||
|
- if (flag) {
|
||||||
|
- ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
||||||
|
- } else {
|
||||||
|
- itemstack2.enchant(weightedrandomenchant.enchantment, weightedrandomenchant.level);
|
||||||
+ for (Map.Entry<org.bukkit.enchantments.Enchantment, Integer> entry : event.getEnchantsToAdd().entrySet()) {
|
+ for (Map.Entry<org.bukkit.enchantments.Enchantment, Integer> entry : event.getEnchantsToAdd().entrySet()) {
|
||||||
+ try {
|
+ try {
|
||||||
+ if (flag) {
|
+ if (flag) {
|
||||||
@ -149,11 +154,7 @@
|
|||||||
+ if (nms == null) {
|
+ if (nms == null) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
- if (flag) {
|
|
||||||
- ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
|
||||||
- } else {
|
|
||||||
- itemstack2.enchant(weightedrandomenchant.enchantment, weightedrandomenchant.level);
|
|
||||||
+ WeightedRandomEnchant weightedrandomenchant = new WeightedRandomEnchant(nms, entry.getValue());
|
+ WeightedRandomEnchant weightedrandomenchant = new WeightedRandomEnchant(nms, entry.getValue());
|
||||||
+ ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
+ ItemEnchantedBook.addEnchantment(itemstack2, weightedrandomenchant);
|
||||||
+ } else {
|
+ } else {
|
||||||
@ -171,7 +172,7 @@
|
|||||||
if (!entityhuman.getAbilities().instabuild) {
|
if (!entityhuman.getAbilities().instabuild) {
|
||||||
itemstack1.shrink(j);
|
itemstack1.shrink(j);
|
||||||
if (itemstack1.isEmpty()) {
|
if (itemstack1.isEmpty()) {
|
||||||
@@ -265,6 +357,7 @@
|
@@ -254,6 +346,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean stillValid(EntityHuman entityhuman) {
|
public boolean stillValid(EntityHuman entityhuman) {
|
||||||
@ -179,7 +180,7 @@
|
|||||||
return stillValid(this.access, entityhuman, Blocks.ENCHANTING_TABLE);
|
return stillValid(this.access, entityhuman, Blocks.ENCHANTING_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,4 +409,17 @@
|
@@ -305,4 +398,17 @@
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/ItemBoneMeal.java
|
--- a/net/minecraft/world/item/ItemBoneMeal.java
|
||||||
+++ b/net/minecraft/world/item/ItemBoneMeal.java
|
+++ b/net/minecraft/world/item/ItemBoneMeal.java
|
||||||
@@ -35,6 +35,12 @@
|
@@ -33,6 +33,12 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumInteractionResult useOn(ItemActionContext itemactioncontext) {
|
public EnumInteractionResult useOn(ItemActionContext itemactioncontext) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/ItemEnderEye.java
|
--- a/net/minecraft/world/item/ItemEnderEye.java
|
||||||
+++ b/net/minecraft/world/item/ItemEnderEye.java
|
+++ b/net/minecraft/world/item/ItemEnderEye.java
|
||||||
@@ -85,7 +85,11 @@
|
@@ -86,7 +86,11 @@
|
||||||
|
|
||||||
entityendersignal.setItem(itemstack);
|
entityendersignal.setItem(itemstack);
|
||||||
entityendersignal.signalTo(blockposition);
|
entityendersignal.signalTo(blockposition);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/ItemLeash.java
|
--- a/net/minecraft/world/item/ItemLeash.java
|
||||||
+++ b/net/minecraft/world/item/ItemLeash.java
|
+++ b/net/minecraft/world/item/ItemLeash.java
|
||||||
@@ -14,6 +14,8 @@
|
@@ -13,6 +13,8 @@
|
||||||
import net.minecraft.world.level.block.state.IBlockData;
|
import net.minecraft.world.level.block.state.IBlockData;
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
public class ItemLeash extends Item {
|
public class ItemLeash extends Item {
|
||||||
|
|
||||||
public ItemLeash(Item.Info item_info) {
|
public ItemLeash(Item.Info item_info) {
|
||||||
@@ -55,9 +57,25 @@
|
@@ -54,9 +56,25 @@
|
||||||
if (entityinsentient.getLeashHolder() == entityhuman) {
|
if (entityinsentient.getLeashHolder() == entityhuman) {
|
||||||
if (entityleash == null) {
|
if (entityleash == null) {
|
||||||
entityleash = EntityLeash.getOrCreateKnot(world, blockposition);
|
entityleash = EntityLeash.getOrCreateKnot(world, blockposition);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/ItemMinecart.java
|
--- a/net/minecraft/world/item/ItemMinecart.java
|
||||||
+++ b/net/minecraft/world/item/ItemMinecart.java
|
+++ b/net/minecraft/world/item/ItemMinecart.java
|
||||||
@@ -18,6 +18,11 @@
|
@@ -17,6 +17,11 @@
|
||||||
import net.minecraft.world.level.block.state.properties.BlockPropertyTrackPosition;
|
import net.minecraft.world.level.block.state.properties.BlockPropertyTrackPosition;
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class ItemMinecart extends Item {
|
public class ItemMinecart extends Item {
|
||||||
|
|
||||||
private static final IDispenseBehavior DISPENSE_ITEM_BEHAVIOR = new DispenseBehaviorItem() {
|
private static final IDispenseBehavior DISPENSE_ITEM_BEHAVIOR = new DispenseBehaviorItem() {
|
||||||
@@ -56,14 +61,43 @@
|
@@ -55,14 +60,43 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@
|
|||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +139,12 @@
|
@@ -104,7 +138,12 @@
|
||||||
entityminecartabstract.setCustomName(itemstack.getHoverName());
|
entityminecartabstract.setCustomName(itemstack.getHoverName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/item/ItemStack.java
|
--- a/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/net/minecraft/world/item/ItemStack.java
|
+++ b/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -72,6 +72,40 @@
|
@@ -73,6 +73,40 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.block.state.pattern.ShapeDetectorBlock;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import com.mojang.serialization.Dynamic;
|
+import com.mojang.serialization.Dynamic;
|
||||||
@ -41,7 +41,7 @@
|
|||||||
public final class ItemStack {
|
public final class ItemStack {
|
||||||
|
|
||||||
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
|
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||||
@@ -139,16 +173,30 @@
|
@@ -144,16 +178,30 @@
|
||||||
this.updateEmptyCacheFlag();
|
this.updateEmptyCacheFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@
|
|||||||
this.getItem().verifyTagAfterLoad(this.tag);
|
this.getItem().verifyTagAfterLoad(this.tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +204,11 @@
|
@@ -161,6 +209,11 @@
|
||||||
this.setDamageValue(this.getDamageValue());
|
this.setDamageValue(this.getDamageValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +86,8 @@
|
|||||||
this.updateEmptyCacheFlag();
|
this.updateEmptyCacheFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +246,7 @@
|
@@ -202,7 +255,7 @@
|
||||||
return this.getItem() == item;
|
return this.getItem().builtInRegistryHolder().tags();
|
||||||
}
|
}
|
||||||
|
|
||||||
- public EnumInteractionResult useOn(ItemActionContext itemactioncontext) {
|
- public EnumInteractionResult useOn(ItemActionContext itemactioncontext) {
|
||||||
@ -95,8 +95,8 @@
|
|||||||
EntityHuman entityhuman = itemactioncontext.getPlayer();
|
EntityHuman entityhuman = itemactioncontext.getPlayer();
|
||||||
BlockPosition blockposition = itemactioncontext.getClickedPos();
|
BlockPosition blockposition = itemactioncontext.getClickedPos();
|
||||||
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getLevel(), blockposition, false);
|
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getLevel(), blockposition, false);
|
||||||
@@ -201,12 +254,157 @@
|
@@ -210,12 +263,157 @@
|
||||||
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.hasAdventureModePlaceTagForBlock(itemactioncontext.getLevel().getTagManager(), shapedetectorblock)) {
|
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.hasAdventureModePlaceTagForBlock(itemactioncontext.getLevel().registryAccess().registryOrThrow(IRegistry.BLOCK_REGISTRY), shapedetectorblock)) {
|
||||||
return EnumInteractionResult.PASS;
|
return EnumInteractionResult.PASS;
|
||||||
} else {
|
} else {
|
||||||
+ // CraftBukkit start - handle all block place event logic here
|
+ // CraftBukkit start - handle all block place event logic here
|
||||||
@ -254,7 +254,7 @@
|
|||||||
|
|
||||||
return enuminteractionresult;
|
return enuminteractionresult;
|
||||||
}
|
}
|
||||||
@@ -287,6 +485,21 @@
|
@@ -296,6 +494,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
i -= k;
|
i -= k;
|
||||||
@ -276,7 +276,7 @@
|
|||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -308,6 +521,11 @@
|
@@ -317,6 +530,11 @@
|
||||||
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||||
consumer.accept(t0);
|
consumer.accept(t0);
|
||||||
Item item = this.getItem();
|
Item item = this.getItem();
|
||||||
@ -288,7 +288,7 @@
|
|||||||
|
|
||||||
this.shrink(1);
|
this.shrink(1);
|
||||||
if (t0 instanceof EntityHuman) {
|
if (t0 instanceof EntityHuman) {
|
||||||
@@ -463,6 +681,17 @@
|
@@ -472,6 +690,17 @@
|
||||||
return this.tag;
|
return this.tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +306,7 @@
|
|||||||
public NBTTagCompound getOrCreateTag() {
|
public NBTTagCompound getOrCreateTag() {
|
||||||
if (this.tag == null) {
|
if (this.tag == null) {
|
||||||
this.setTag(new NBTTagCompound());
|
this.setTag(new NBTTagCompound());
|
||||||
@@ -843,6 +1072,12 @@
|
@@ -850,6 +1079,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRepairCost(int i) {
|
public void setRepairCost(int i) {
|
||||||
@ -319,7 +319,7 @@
|
|||||||
this.getOrCreateTag().putInt("RepairCost", i);
|
this.getOrCreateTag().putInt("RepairCost", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,6 +1127,13 @@
|
@@ -899,6 +1134,13 @@
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/ItemWorldMap.java
|
--- a/net/minecraft/world/item/ItemWorldMap.java
|
||||||
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
||||||
@@ -33,6 +33,11 @@
|
@@ -32,6 +32,11 @@
|
||||||
import net.minecraft.world.level.material.MaterialMapColor;
|
import net.minecraft.world.level.material.MaterialMapColor;
|
||||||
import net.minecraft.world.level.saveddata.maps.WorldMap;
|
import net.minecraft.world.level.saveddata.maps.WorldMap;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class ItemWorldMap extends ItemWorldMapBase {
|
public class ItemWorldMap extends ItemWorldMapBase {
|
||||||
|
|
||||||
public static final int IMAGE_WIDTH = 128;
|
public static final int IMAGE_WIDTH = 128;
|
||||||
@@ -67,7 +72,7 @@
|
@@ -66,7 +71,7 @@
|
||||||
public static Integer getMapId(ItemStack itemstack) {
|
public static Integer getMapId(ItemStack itemstack) {
|
||||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|
||||||
|
|
||||||
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||||
@@ -75,6 +80,10 @@
|
@@ -74,6 +79,10 @@
|
||||||
int l = world.getFreeMapId();
|
int l = world.getFreeMapId();
|
||||||
|
|
||||||
world.setMapData(makeKey(l), worldmap);
|
world.setMapData(makeKey(l), worldmap);
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
--- a/net/minecraft/world/item/crafting/CraftingManager.java
|
--- a/net/minecraft/world/item/crafting/CraftingManager.java
|
||||||
+++ b/net/minecraft/world/item/crafting/CraftingManager.java
|
+++ b/net/minecraft/world/item/crafting/CraftingManager.java
|
||||||
@@ -33,11 +33,13 @@
|
@@ -32,11 +32,13 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.level.World;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit
|
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit
|
||||||
+
|
+
|
||||||
public class CraftingManager extends ResourceDataJson {
|
public class CraftingManager extends ResourceDataJson {
|
||||||
|
|
||||||
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create();
|
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create();
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
- public Map<Recipes<?>, Map<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of();
|
- public Map<Recipes<?>, Map<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of();
|
||||||
+ public Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of(); // CraftBukkit
|
+ public Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of(); // CraftBukkit
|
||||||
private Map<MinecraftKey, IRecipe<?>> byName = ImmutableMap.of();
|
private Map<MinecraftKey, IRecipe<?>> byName = ImmutableMap.of();
|
||||||
private boolean hasErrors;
|
private boolean hasErrors;
|
||||||
|
|
||||||
@@ -47,7 +49,12 @@
|
@@ -46,7 +48,12 @@
|
||||||
|
|
||||||
protected void apply(Map<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
protected void apply(Map<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
||||||
this.hasErrors = false;
|
this.hasErrors = false;
|
||||||
@ -29,7 +29,7 @@
|
|||||||
Builder<MinecraftKey, IRecipe<?>> builder = ImmutableMap.builder();
|
Builder<MinecraftKey, IRecipe<?>> builder = ImmutableMap.builder();
|
||||||
Iterator iterator = map.entrySet().iterator();
|
Iterator iterator = map.entrySet().iterator();
|
||||||
|
|
||||||
@@ -58,8 +65,10 @@
|
@@ -57,8 +64,10 @@
|
||||||
try {
|
try {
|
||||||
IRecipe<?> irecipe = fromJson(minecraftkey, ChatDeserializer.convertToJsonObject((JsonElement) entry.getValue(), "top element"));
|
IRecipe<?> irecipe = fromJson(minecraftkey, ChatDeserializer.convertToJsonObject((JsonElement) entry.getValue(), "top element"));
|
||||||
|
|
||||||
@ -42,7 +42,7 @@
|
|||||||
})).put(minecraftkey, irecipe);
|
})).put(minecraftkey, irecipe);
|
||||||
builder.put(minecraftkey, irecipe);
|
builder.put(minecraftkey, irecipe);
|
||||||
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
||||||
@@ -68,20 +77,37 @@
|
@@ -67,20 +76,37 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
||||||
@ -75,7 +75,7 @@
|
|||||||
- return this.byType(recipes).values().stream().flatMap((irecipe) -> {
|
- return this.byType(recipes).values().stream().flatMap((irecipe) -> {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ Optional<T> recipe = this.byType(recipes).values().stream().flatMap((irecipe) -> {
|
+ Optional<T> recipe = this.byType(recipes).values().stream().flatMap((irecipe) -> {
|
||||||
return SystemUtils.toStream(recipes.tryMatch(irecipe, world, c0));
|
return recipes.tryMatch(irecipe, world, c0).stream();
|
||||||
}).findFirst();
|
}).findFirst();
|
||||||
+ c0.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
+ c0.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
@ -83,7 +83,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <C extends IInventory, T extends IRecipe<C>> List<T> getAllRecipesFor(Recipes<T> recipes) {
|
public <C extends IInventory, T extends IRecipe<C>> List<T> getAllRecipesFor(Recipes<T> recipes) {
|
||||||
@@ -99,7 +125,7 @@
|
@@ -98,7 +124,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, IRecipe<C>> byType(Recipes<T> recipes) {
|
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, IRecipe<C>> byType(Recipes<T> recipes) {
|
||||||
@ -92,7 +92,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <C extends IInventory, T extends IRecipe<C>> NonNullList<ItemStack> getRemainingItemsFor(Recipes<T> recipes, C c0, World world) {
|
public <C extends IInventory, T extends IRecipe<C>> NonNullList<ItemStack> getRemainingItemsFor(Recipes<T> recipes, C c0, World world) {
|
||||||
@@ -119,7 +145,7 @@
|
@@ -118,7 +144,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<? extends IRecipe<?>> byKey(MinecraftKey minecraftkey) {
|
public Optional<? extends IRecipe<?>> byKey(MinecraftKey minecraftkey) {
|
||||||
@ -101,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Collection<IRecipe<?>> getRecipes() {
|
public Collection<IRecipe<?>> getRecipes() {
|
||||||
@@ -144,12 +170,12 @@
|
@@ -143,12 +169,12 @@
|
||||||
|
|
||||||
public void replaceRecipes(Iterable<IRecipe<?>> iterable) {
|
public void replaceRecipes(Iterable<IRecipe<?>> iterable) {
|
||||||
this.hasErrors = false;
|
this.hasErrors = false;
|
||||||
@ -116,7 +116,7 @@
|
|||||||
});
|
});
|
||||||
MinecraftKey minecraftkey = irecipe.getId();
|
MinecraftKey minecraftkey = irecipe.getId();
|
||||||
IRecipe<?> irecipe1 = (IRecipe) map1.put(minecraftkey, irecipe);
|
IRecipe<?> irecipe1 = (IRecipe) map1.put(minecraftkey, irecipe);
|
||||||
@@ -160,6 +186,26 @@
|
@@ -159,6 +185,26 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.recipes = ImmutableMap.copyOf(map);
|
this.recipes = ImmutableMap.copyOf(map);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
--- a/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
||||||
+++ b/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
+++ b/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
|
||||||
@@ -57,8 +57,11 @@
|
@@ -56,8 +56,11 @@
|
||||||
IBlockData iblockdata2 = world.getBlockState(blockposition1);
|
IBlockData iblockdata2 = world.getBlockState(blockposition1);
|
||||||
|
|
||||||
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.getValue(BlockFluids.LEVEL) == 0 && iblockdata.canSurvive(world, blockposition1) && world.isUnobstructed(iblockdata, blockposition1, VoxelShapeCollision.empty())) {
|
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.getValue(BlockFluids.LEVEL) == 0 && iblockdata.canSurvive(world, blockposition1) && world.isUnobstructed(iblockdata, blockposition1, VoxelShapeCollision.empty())) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/level/RayTrace.java
|
--- a/net/minecraft/world/level/RayTrace.java
|
||||||
+++ b/net/minecraft/world/level/RayTrace.java
|
+++ b/net/minecraft/world/level/RayTrace.java
|
||||||
@@ -24,7 +24,7 @@
|
@@ -26,7 +26,7 @@
|
||||||
this.to = vec3d1;
|
this.to = vec3d1;
|
||||||
this.block = raytrace_blockcollisionoption;
|
this.block = raytrace_blockcollisionoption;
|
||||||
this.fluid = raytrace_fluidcollisionoption;
|
this.fluid = raytrace_fluidcollisionoption;
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Vec3D getTo() {
|
public Vec3D getTo() {
|
||||||
@@ -69,7 +69,7 @@
|
@@ -75,7 +75,7 @@
|
||||||
|
|
||||||
private final Predicate<Fluid> canPick;
|
private final Predicate<Fluid> canPick;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/level/SpawnerCreature.java
|
--- a/net/minecraft/world/level/SpawnerCreature.java
|
||||||
+++ b/net/minecraft/world/level/SpawnerCreature.java
|
+++ b/net/minecraft/world/level/SpawnerCreature.java
|
||||||
@@ -47,6 +47,13 @@
|
@@ -47,6 +47,13 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import net.minecraft.world.level.storage.WorldData;
|
+import net.minecraft.world.level.storage.WorldData;
|
||||||
@ -13,7 +13,7 @@
|
|||||||
+
|
+
|
||||||
public final class SpawnerCreature {
|
public final class SpawnerCreature {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -73,7 +80,8 @@
|
@@ -73,7 +80,8 @@
|
||||||
if (entity instanceof EntityInsentient) {
|
if (entity instanceof EntityInsentient) {
|
||||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||||
@ -70,7 +70,7 @@
|
|||||||
if (j >= entityinsentient.getMaxSpawnClusterSize()) {
|
if (j >= entityinsentient.getMaxSpawnClusterSize()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -377,7 +404,7 @@
|
@@ -383,7 +410,7 @@
|
||||||
|
|
||||||
if (entityinsentient.checkSpawnRules(worldaccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.checkSpawnObstruction(worldaccess)) {
|
if (entityinsentient.checkSpawnRules(worldaccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.checkSpawnObstruction(worldaccess)) {
|
||||||
groupdataentity = entityinsentient.finalizeSpawn(worldaccess, worldaccess.getCurrentDifficultyAt(entityinsentient.blockPosition()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);
|
groupdataentity = entityinsentient.finalizeSpawn(worldaccess, worldaccess.getCurrentDifficultyAt(entityinsentient.blockPosition()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);
|
||||||
@ -79,7 +79,7 @@
|
|||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,8 +525,10 @@
|
@@ -504,8 +531,10 @@
|
||||||
return this.unmodifiableMobCategoryCounts;
|
return this.unmodifiableMobCategoryCounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/StructureManager.java
|
|
||||||
+++ b/net/minecraft/world/level/StructureManager.java
|
|
||||||
@@ -1,3 +1,4 @@
|
|
||||||
+// mc-dev import
|
|
||||||
package net.minecraft.world.level;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
@ -1,8 +1,8 @@
|
|||||||
--- a/net/minecraft/world/level/World.java
|
--- a/net/minecraft/world/level/World.java
|
||||||
+++ b/net/minecraft/world/level/World.java
|
+++ b/net/minecraft/world/level/World.java
|
||||||
@@ -67,6 +67,31 @@
|
@@ -65,6 +65,31 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import org.apache.logging.log4j.Logger;
|
import net.minecraft.world.scores.Scoreboard;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import java.util.HashMap;
|
+import java.util.HashMap;
|
||||||
@ -31,12 +31,12 @@
|
|||||||
+
|
+
|
||||||
public abstract class World implements GeneratorAccess, AutoCloseable {
|
public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||||
|
|
||||||
protected static final Logger LOGGER = LogManager.getLogger();
|
public static final Codec<ResourceKey<World>> RESOURCE_KEY_CODEC = MinecraftKey.CODEC.xmap(ResourceKey.elementKey(IRegistry.DIMENSION_REGISTRY), ResourceKey::location);
|
||||||
@@ -104,7 +129,43 @@
|
@@ -102,7 +127,43 @@
|
||||||
private final ResourceKey<World> dimension;
|
private final ResourceKey<World> dimension;
|
||||||
private long subTickCount;
|
private long subTickCount;
|
||||||
|
|
||||||
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i) {
|
||||||
+ // CraftBukkit start Added the following
|
+ // CraftBukkit start Added the following
|
||||||
+ private final CraftWorld world;
|
+ private final CraftWorld world;
|
||||||
+ public boolean pvpMode;
|
+ public boolean pvpMode;
|
||||||
@ -62,7 +62,7 @@
|
|||||||
+
|
+
|
||||||
+ public abstract ResourceKey<WorldDimension> getTypeKey();
|
+ public abstract ResourceKey<WorldDimension> getTypeKey();
|
||||||
+
|
+
|
||||||
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, Holder<DimensionManager> holder, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||||
+ this.generator = gen;
|
+ this.generator = gen;
|
||||||
+ this.world = new CraftWorld((WorldServer) this, gen, biomeProvider, env);
|
+ this.world = new CraftWorld((WorldServer) this, gen, biomeProvider, env);
|
||||||
+
|
+
|
||||||
@ -76,23 +76,23 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.profiler = supplier;
|
this.profiler = supplier;
|
||||||
this.levelData = worlddatamutable;
|
this.levelData = worlddatamutable;
|
||||||
this.dimensionType = dimensionmanager;
|
this.dimensionTypeRegistration = holder;
|
||||||
@@ -114,12 +175,12 @@
|
@@ -113,12 +174,12 @@
|
||||||
this.worldBorder = new WorldBorder() {
|
this.worldBorder = new WorldBorder() {
|
||||||
@Override
|
@Override
|
||||||
public double getCenterX() {
|
public double getCenterX() {
|
||||||
- return super.getCenterX() / dimensionmanager.coordinateScale();
|
- return super.getCenterX() / World.this.dimensionType.coordinateScale();
|
||||||
+ return super.getCenterX(); // CraftBukkit
|
+ return super.getCenterX(); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getCenterZ() {
|
public double getCenterZ() {
|
||||||
- return super.getCenterZ() / dimensionmanager.coordinateScale();
|
- return super.getCenterZ() / World.this.dimensionType.coordinateScale();
|
||||||
+ return super.getCenterZ(); // CraftBukkit
|
+ return super.getCenterZ(); // CraftBukkit
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@@ -129,6 +190,42 @@
|
@@ -128,6 +189,42 @@
|
||||||
this.thread = Thread.currentThread();
|
this.thread = Thread.currentThread();
|
||||||
this.biomeManager = new BiomeManager(this, i);
|
this.biomeManager = new BiomeManager(this, i);
|
||||||
this.isDebug = flag1;
|
this.isDebug = flag1;
|
||||||
@ -135,7 +135,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -186,6 +283,17 @@
|
@@ -185,6 +282,17 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
|
public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
|
||||||
@ -153,7 +153,7 @@
|
|||||||
if (this.isOutsideBuildHeight(blockposition)) {
|
if (this.isOutsideBuildHeight(blockposition)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!this.isClientSide && this.isDebug()) {
|
} else if (!this.isClientSide && this.isDebug()) {
|
||||||
@@ -193,9 +301,24 @@
|
@@ -192,9 +300,24 @@
|
||||||
} else {
|
} else {
|
||||||
Chunk chunk = this.getChunkAt(blockposition);
|
Chunk chunk = this.getChunkAt(blockposition);
|
||||||
Block block = iblockdata.getBlock();
|
Block block = iblockdata.getBlock();
|
||||||
@ -179,7 +179,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
IBlockData iblockdata2 = this.getBlockState(blockposition);
|
IBlockData iblockdata2 = this.getBlockState(blockposition);
|
||||||
@@ -206,6 +329,7 @@
|
@@ -205,6 +328,7 @@
|
||||||
this.getProfiler().pop();
|
this.getProfiler().pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@
|
|||||||
if (iblockdata2 == iblockdata) {
|
if (iblockdata2 == iblockdata) {
|
||||||
if (iblockdata1 != iblockdata2) {
|
if (iblockdata1 != iblockdata2) {
|
||||||
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
||||||
@@ -232,12 +356,69 @@
|
@@ -231,12 +355,69 @@
|
||||||
|
|
||||||
this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
|
this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@
|
|||||||
public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -327,6 +508,17 @@
|
@@ -326,6 +507,17 @@
|
||||||
IBlockData iblockdata = this.getBlockState(blockposition);
|
IBlockData iblockdata = this.getBlockState(blockposition);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -275,7 +275,7 @@
|
|||||||
iblockdata.neighborChanged(this, blockposition, block, blockposition1, false);
|
iblockdata.neighborChanged(this, blockposition, block, blockposition1, false);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception while updating neighbours");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception while updating neighbours");
|
||||||
@@ -369,6 +561,14 @@
|
@@ -368,6 +560,14 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockData getBlockState(BlockPosition blockposition) {
|
public IBlockData getBlockState(BlockPosition blockposition) {
|
||||||
@ -290,7 +290,7 @@
|
|||||||
if (this.isOutsideBuildHeight(blockposition)) {
|
if (this.isOutsideBuildHeight(blockposition)) {
|
||||||
return Blocks.VOID_AIR.defaultBlockState();
|
return Blocks.VOID_AIR.defaultBlockState();
|
||||||
} else {
|
} else {
|
||||||
@@ -494,6 +694,16 @@
|
@@ -493,6 +693,16 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public TileEntity getBlockEntity(BlockPosition blockposition) {
|
public TileEntity getBlockEntity(BlockPosition blockposition) {
|
||||||
@ -307,7 +307,7 @@
|
|||||||
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
|
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,6 +711,12 @@
|
@@ -500,6 +710,12 @@
|
||||||
BlockPosition blockposition = tileentity.getBlockPos();
|
BlockPosition blockposition = tileentity.getBlockPos();
|
||||||
|
|
||||||
if (!this.isOutsideBuildHeight(blockposition)) {
|
if (!this.isOutsideBuildHeight(blockposition)) {
|
||||||
@ -320,7 +320,7 @@
|
|||||||
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
|
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -605,7 +821,7 @@
|
@@ -604,7 +820,7 @@
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
EntityComplexPart entitycomplexpart = aentitycomplexpart[j];
|
EntityComplexPart entitycomplexpart = aentitycomplexpart[j];
|
||||||
@ -329,7 +329,7 @@
|
|||||||
|
|
||||||
if (t0 != null && predicate.test(t0)) {
|
if (t0 != null && predicate.test(t0)) {
|
||||||
list.add(t0);
|
list.add(t0);
|
||||||
@@ -931,6 +1147,14 @@
|
@@ -932,6 +1148,14 @@
|
||||||
public abstract LevelEntityGetter<Entity> getEntities();
|
public abstract LevelEntityGetter<Entity> getEntities();
|
||||||
|
|
||||||
protected void postGameEventInRadius(@Nullable Entity entity, GameEvent gameevent, BlockPosition blockposition, int i) {
|
protected void postGameEventInRadius(@Nullable Entity entity, GameEvent gameevent, BlockPosition blockposition, int i) {
|
||||||
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren