@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -125,8 +125,65 @@
|
||||
@@ -126,8 +126,65 @@
|
||||
import org.joml.Vector3f;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
+import org.bukkit.plugin.PluginManager;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class Entity implements INamableTileEntity, EntityAccess, ICommandListener {
|
||||
public abstract class Entity implements INamableTileEntity, EntityAccess, ICommandListener, ScoreHolder {
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ private static final int CURRENT_LEVEL = 2;
|
||||
@@ -66,16 +66,7 @@
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final String ID_TAG = "id";
|
||||
public static final String PASSENGERS_TAG = "Passengers";
|
||||
@@ -189,7 +246,7 @@
|
||||
public double zOld;
|
||||
private float maxUpStep;
|
||||
public boolean noPhysics;
|
||||
- protected final RandomSource random;
|
||||
+ public final RandomSource random;
|
||||
public int tickCount;
|
||||
private int remainingFireTicks;
|
||||
public boolean wasTouchingWater;
|
||||
@@ -241,6 +298,29 @@
|
||||
@@ -242,6 +299,29 @@
|
||||
public boolean hasVisualFire;
|
||||
@Nullable
|
||||
private IBlockData feetBlockState;
|
||||
@@ -105,7 +96,7 @@
|
||||
|
||||
public Entity(EntityTypes<?> entitytypes, World world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
@@ -374,6 +454,12 @@
|
||||
@@ -375,6 +455,12 @@
|
||||
public void onClientRemoval() {}
|
||||
|
||||
public void setPose(EntityPose entitypose) {
|
||||
@@ -118,7 +109,7 @@
|
||||
this.entityData.set(Entity.DATA_POSE, entitypose);
|
||||
}
|
||||
|
||||
@@ -398,6 +484,33 @@
|
||||
@@ -399,6 +485,33 @@
|
||||
}
|
||||
|
||||
protected void setRot(float f, float f1) {
|
||||
@@ -152,7 +143,7 @@
|
||||
this.setYRot(f % 360.0F);
|
||||
this.setXRot(f1 % 360.0F);
|
||||
}
|
||||
@@ -439,6 +552,15 @@
|
||||
@@ -440,6 +553,15 @@
|
||||
this.baseTick();
|
||||
}
|
||||
|
||||
@@ -168,7 +159,7 @@
|
||||
public void baseTick() {
|
||||
this.level().getProfiler().push("entityBaseTick");
|
||||
this.feetBlockState = null;
|
||||
@@ -453,7 +575,7 @@
|
||||
@@ -454,7 +576,7 @@
|
||||
this.walkDistO = this.walkDist;
|
||||
this.xRotO = this.getXRot();
|
||||
this.yRotO = this.getYRot();
|
||||
@@ -177,7 +168,7 @@
|
||||
if (this.canSpawnSprintParticle()) {
|
||||
this.spawnSprintParticle();
|
||||
}
|
||||
@@ -488,6 +610,10 @@
|
||||
@@ -489,6 +611,10 @@
|
||||
if (this.isInLava()) {
|
||||
this.lavaHurt();
|
||||
this.fallDistance *= 0.5F;
|
||||
@@ -188,7 +179,7 @@
|
||||
}
|
||||
|
||||
this.checkBelowWorld();
|
||||
@@ -539,15 +665,48 @@
|
||||
@@ -540,15 +666,48 @@
|
||||
|
||||
public void lavaHurt() {
|
||||
if (!this.fireImmune()) {
|
||||
@@ -238,7 +229,7 @@
|
||||
int j = i * 20;
|
||||
|
||||
if (this instanceof EntityLiving) {
|
||||
@@ -698,6 +857,28 @@
|
||||
@@ -699,6 +858,28 @@
|
||||
block.updateEntityAfterFallOn(this.level(), this);
|
||||
}
|
||||
|
||||
@@ -267,7 +258,7 @@
|
||||
if (this.onGround()) {
|
||||
block.stepOn(this.level(), blockposition, iblockdata, this);
|
||||
}
|
||||
@@ -1025,6 +1206,20 @@
|
||||
@@ -1026,6 +1207,20 @@
|
||||
return SoundEffects.GENERIC_SPLASH;
|
||||
}
|
||||
|
||||
@@ -288,7 +279,7 @@
|
||||
protected void checkInsideBlocks() {
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox();
|
||||
BlockPosition blockposition = BlockPosition.containing(axisalignedbb.minX + 1.0E-7D, axisalignedbb.minY + 1.0E-7D, axisalignedbb.minZ + 1.0E-7D);
|
||||
@@ -1439,6 +1634,7 @@
|
||||
@@ -1440,6 +1635,7 @@
|
||||
this.yo = d1;
|
||||
this.zo = d4;
|
||||
this.setPos(d3, d1, d4);
|
||||
@@ -296,7 +287,7 @@
|
||||
}
|
||||
|
||||
public void moveTo(Vec3D vec3d) {
|
||||
@@ -1633,6 +1829,12 @@
|
||||
@@ -1634,6 +1830,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -309,7 +300,7 @@
|
||||
public void awardKillScore(Entity entity, int i, DamageSource damagesource) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
CriterionTriggers.ENTITY_KILLED_PLAYER.trigger((EntityPlayer) entity, this, damagesource);
|
||||
@@ -1661,16 +1863,22 @@
|
||||
@@ -1662,16 +1864,22 @@
|
||||
}
|
||||
|
||||
public boolean saveAsPassenger(NBTTagCompound nbttagcompound) {
|
||||
@@ -334,7 +325,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1681,16 +1889,38 @@
|
||||
@@ -1682,16 +1890,38 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound saveWithoutId(NBTTagCompound nbttagcompound) {
|
||||
@@ -377,7 +368,7 @@
|
||||
nbttagcompound.put("Rotation", this.newFloatList(this.getYRot(), this.getXRot()));
|
||||
nbttagcompound.putFloat("FallDistance", this.fallDistance);
|
||||
nbttagcompound.putShort("Fire", (short) this.remainingFireTicks);
|
||||
@@ -1698,7 +1928,28 @@
|
||||
@@ -1699,7 +1929,28 @@
|
||||
nbttagcompound.putBoolean("OnGround", this.onGround());
|
||||
nbttagcompound.putBoolean("Invulnerable", this.invulnerable);
|
||||
nbttagcompound.putInt("PortalCooldown", this.portalCooldown);
|
||||
@@ -407,7 +398,7 @@
|
||||
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
||||
|
||||
if (ichatbasecomponent != null) {
|
||||
@@ -1747,7 +1998,7 @@
|
||||
@@ -1748,7 +1999,7 @@
|
||||
nbttagcompound.put("Tags", nbttaglist);
|
||||
}
|
||||
|
||||
@@ -416,7 +407,7 @@
|
||||
if (this.isVehicle()) {
|
||||
nbttaglist = new NBTTagList();
|
||||
iterator = this.getPassengers().iterator();
|
||||
@@ -1756,7 +2007,7 @@
|
||||
@@ -1757,7 +2008,7 @@
|
||||
Entity entity = (Entity) iterator.next();
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
||||
@@ -425,7 +416,7 @@
|
||||
nbttaglist.add(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
@@ -1766,6 +2017,11 @@
|
||||
@@ -1767,6 +2018,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +428,7 @@
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -1849,6 +2105,45 @@
|
||||
@@ -1850,6 +2106,45 @@
|
||||
} else {
|
||||
throw new IllegalStateException("Entity has invalid position");
|
||||
}
|
||||
@@ -483,7 +474,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
|
||||
@@ -1870,6 +2165,12 @@
|
||||
@@ -1871,6 +2166,12 @@
|
||||
return entitytypes.canSerialize() && minecraftkey != null ? minecraftkey.toString() : null;
|
||||
}
|
||||
|
||||
@@ -496,7 +487,7 @@
|
||||
protected abstract void readAdditionalSaveData(NBTTagCompound nbttagcompound);
|
||||
|
||||
protected abstract void addAdditionalSaveData(NBTTagCompound nbttagcompound);
|
||||
@@ -1924,9 +2225,22 @@
|
||||
@@ -1925,9 +2226,22 @@
|
||||
} else if (this.level().isClientSide) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -519,7 +510,7 @@
|
||||
this.level().addFreshEntity(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
@@ -2024,6 +2338,18 @@
|
||||
@@ -2025,6 +2339,18 @@
|
||||
if (!flag && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -538,7 +529,7 @@
|
||||
if (this.isPassenger()) {
|
||||
this.stopRiding();
|
||||
}
|
||||
@@ -2057,7 +2383,7 @@
|
||||
@@ -2058,7 +2384,7 @@
|
||||
Entity entity = this.vehicle;
|
||||
|
||||
this.vehicle = null;
|
||||
@@ -547,7 +538,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2088,10 +2414,29 @@
|
||||
@@ -2089,10 +2415,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +569,7 @@
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -2103,6 +2448,7 @@
|
||||
@@ -2104,6 +2449,7 @@
|
||||
entity.boardingCooldown = 60;
|
||||
this.gameEvent(GameEvent.ENTITY_DISMOUNT, entity);
|
||||
}
|
||||
@@ -586,7 +577,7 @@
|
||||
}
|
||||
|
||||
protected boolean canAddPassenger(Entity entity) {
|
||||
@@ -2189,14 +2535,20 @@
|
||||
@@ -2190,14 +2536,20 @@
|
||||
|
||||
if (this.isInsidePortal) {
|
||||
MinecraftServer minecraftserver = worldserver.getServer();
|
||||
@@ -610,7 +601,7 @@
|
||||
this.level().getProfiler().pop();
|
||||
}
|
||||
|
||||
@@ -2320,6 +2672,13 @@
|
||||
@@ -2321,6 +2673,13 @@
|
||||
}
|
||||
|
||||
public void setSwimming(boolean flag) {
|
||||
@@ -624,7 +615,7 @@
|
||||
this.setSharedFlag(4, flag);
|
||||
}
|
||||
|
||||
@@ -2369,8 +2728,12 @@
|
||||
@@ -2370,8 +2729,12 @@
|
||||
return this.getTeam() != null ? this.getTeam().isAlliedTo(scoreboardteambase) : false;
|
||||
}
|
||||
|
||||
@@ -638,7 +629,7 @@
|
||||
}
|
||||
|
||||
public boolean getSharedFlag(int i) {
|
||||
@@ -2389,7 +2752,7 @@
|
||||
@@ -2390,7 +2753,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -647,7 +638,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -2397,7 +2760,18 @@
|
||||
@@ -2398,7 +2761,18 @@
|
||||
}
|
||||
|
||||
public void setAirSupply(int i) {
|
||||
@@ -667,7 +658,7 @@
|
||||
}
|
||||
|
||||
public int getTicksFrozen() {
|
||||
@@ -2424,11 +2798,41 @@
|
||||
@@ -2425,11 +2799,41 @@
|
||||
|
||||
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
||||
this.setRemainingFireTicks(this.remainingFireTicks + 1);
|
||||
@@ -711,7 +702,7 @@
|
||||
}
|
||||
|
||||
public void onAboveBubbleCol(boolean flag) {
|
||||
@@ -2593,15 +2997,38 @@
|
||||
@@ -2594,15 +2998,38 @@
|
||||
|
||||
@Nullable
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
@@ -752,7 +743,7 @@
|
||||
this.level().getProfiler().popPush("reloading");
|
||||
Entity entity = this.getType().create(worldserver);
|
||||
|
||||
@@ -2609,10 +3036,22 @@
|
||||
@@ -2610,10 +3037,22 @@
|
||||
entity.restoreFrom(this);
|
||||
entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot());
|
||||
entity.setDeltaMovement(shapedetectorshape.speed);
|
||||
@@ -778,7 +769,7 @@
|
||||
}
|
||||
|
||||
this.removeAfterChangingDimensions();
|
||||
@@ -2633,20 +3072,34 @@
|
||||
@@ -2634,20 +3073,34 @@
|
||||
|
||||
@Nullable
|
||||
protected ShapeDetectorShape findDimensionEntryPoint(WorldServer worldserver) {
|
||||
@@ -818,7 +809,7 @@
|
||||
IBlockData iblockdata = this.level().getBlockState(this.portalEntrancePos);
|
||||
EnumDirection.EnumAxis enumdirection_enumaxis;
|
||||
Vec3D vec3d;
|
||||
@@ -2663,8 +3116,8 @@
|
||||
@@ -2664,8 +3117,8 @@
|
||||
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
@@ -829,7 +820,7 @@
|
||||
}
|
||||
} else {
|
||||
BlockPosition blockposition1;
|
||||
@@ -2674,8 +3127,14 @@
|
||||
@@ -2675,8 +3128,14 @@
|
||||
} else {
|
||||
blockposition1 = worldserver.getHeightmapPos(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSharedSpawnPos());
|
||||
}
|
||||
@@ -845,7 +836,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2683,8 +3142,23 @@
|
||||
@@ -2684,8 +3143,23 @@
|
||||
return BlockPortalShape.getRelativePosition(blockutil_rectangle, enumdirection_enumaxis, this.position(), this.getDimensions(this.getPose()));
|
||||
}
|
||||
|
||||
@@ -871,7 +862,7 @@
|
||||
}
|
||||
|
||||
public boolean canChangeDimensions() {
|
||||
@@ -2804,6 +3278,12 @@
|
||||
@@ -2806,6 +3280,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -884,7 +875,7 @@
|
||||
public boolean teleportTo(WorldServer worldserver, double d0, double d1, double d2, Set<RelativeMovement> set, float f, float f1) {
|
||||
float f2 = MathHelper.clamp(f1, -90.0F, 90.0F);
|
||||
|
||||
@@ -2823,7 +3303,11 @@
|
||||
@@ -2825,7 +3305,11 @@
|
||||
entity.moveTo(d0, d1, d2, f, f2);
|
||||
entity.setYHeadRot(f);
|
||||
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
@@ -897,7 +888,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2929,7 +3413,26 @@
|
||||
@@ -2931,7 +3415,26 @@
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AxisAlignedBB axisalignedbb) {
|
||||
@@ -925,7 +916,7 @@
|
||||
}
|
||||
|
||||
protected float getEyeHeight(EntityPose entitypose, EntitySize entitysize) {
|
||||
@@ -3240,6 +3743,11 @@
|
||||
@@ -3246,6 +3749,11 @@
|
||||
vec3d = vec3d.add(vec3d1);
|
||||
++k1;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
@@ -250,9 +273,17 @@
|
||||
if (entry != null) {
|
||||
ItemStack itemstack = (ItemStack) entry.getValue();
|
||||
int j = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue());
|
||||
int j = Math.min(this.xpToDurability(i), itemstack.getDamageValue());
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(entityhuman, this, itemstack, entry.getKey(), j);
|
||||
+ j = event.getRepairAmount();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -75,6 +75,19 @@
|
||||
@@ -76,6 +76,19 @@
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
public abstract class EntityInsentient extends EntityLiving implements Targeting {
|
||||
|
||||
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.defineId(EntityInsentient.class, DataWatcherRegistry.BYTE);
|
||||
@@ -122,6 +135,8 @@
|
||||
@@ -123,6 +136,8 @@
|
||||
private BlockPosition restrictCenter;
|
||||
private float restrictRadius;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
|
||||
@@ -147,6 +162,12 @@
|
||||
@@ -148,6 +163,12 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
protected void registerGoals() {}
|
||||
|
||||
public static AttributeProvider.Builder createMobAttributes() {
|
||||
@@ -258,7 +279,38 @@
|
||||
@@ -259,7 +280,38 @@
|
||||
}
|
||||
|
||||
public void setTarget(@Nullable EntityLiving entityliving) {
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -398,6 +450,12 @@
|
||||
@@ -399,6 +451,12 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
@Override
|
||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.addAdditionalSaveData(nbttagcompound);
|
||||
@@ -456,7 +514,7 @@
|
||||
@@ -457,7 +515,7 @@
|
||||
}
|
||||
|
||||
nbttagcompound.put("HandDropChances", nbttaglist3);
|
||||
@@ -103,7 +103,7 @@
|
||||
nbttagcompound2 = new NBTTagCompound();
|
||||
if (this.leashHolder instanceof EntityLiving) {
|
||||
UUID uuid = this.leashHolder.getUUID();
|
||||
@@ -487,16 +545,26 @@
|
||||
@@ -488,16 +546,26 @@
|
||||
nbttagcompound.putBoolean("NoAI", this.isNoAi());
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
NBTTagList nbttaglist;
|
||||
int i;
|
||||
|
||||
@@ -543,6 +611,11 @@
|
||||
@@ -544,6 +612,11 @@
|
||||
}
|
||||
|
||||
this.setNoAi(nbttagcompound.getBoolean("NoAI"));
|
||||
@@ -144,7 +144,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -610,7 +683,7 @@
|
||||
@@ -611,7 +684,7 @@
|
||||
|
||||
protected void pickUpItem(EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItem();
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
if (!itemstack1.isEmpty()) {
|
||||
this.onItemPickup(entityitem);
|
||||
@@ -624,6 +697,12 @@
|
||||
@@ -625,6 +698,12 @@
|
||||
}
|
||||
|
||||
public ItemStack equipItemIfPossible(ItemStack itemstack) {
|
||||
@@ -166,7 +166,7 @@
|
||||
EnumItemSlot enumitemslot = getEquipmentSlotForItem(itemstack);
|
||||
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
|
||||
boolean flag = this.canReplaceCurrentItem(itemstack, itemstack1);
|
||||
@@ -634,11 +713,19 @@
|
||||
@@ -635,11 +714,19 @@
|
||||
flag = itemstack1.isEmpty();
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
|
||||
if (enumitemslot.isArmor() && itemstack.getCount() > 1) {
|
||||
@@ -790,6 +877,7 @@
|
||||
@@ -791,6 +878,7 @@
|
||||
@Override
|
||||
protected final void serverAiStep() {
|
||||
++this.noActionTime;
|
||||
@@ -195,7 +195,7 @@
|
||||
this.level().getProfiler().push("sensing");
|
||||
this.sensing.tick();
|
||||
this.level().getProfiler().pop();
|
||||
@@ -1183,6 +1271,12 @@
|
||||
@@ -1184,6 +1272,12 @@
|
||||
if (!this.isAlive()) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == entityhuman) {
|
||||
@@ -208,7 +208,7 @@
|
||||
this.dropLeash(true, !entityhuman.getAbilities().instabuild);
|
||||
this.gameEvent(GameEvent.ENTITY_INTERACT, entityhuman);
|
||||
return EnumInteractionResult.sidedSuccess(this.level().isClientSide);
|
||||
@@ -1208,6 +1302,12 @@
|
||||
@@ -1209,6 +1303,12 @@
|
||||
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
|
||||
|
||||
if (itemstack.is(Items.LEAD) && this.canBeLeashed(entityhuman)) {
|
||||
@@ -221,7 +221,7 @@
|
||||
this.setLeashedTo(entityhuman, true);
|
||||
itemstack.shrink(1);
|
||||
return EnumInteractionResult.sidedSuccess(this.level().isClientSide);
|
||||
@@ -1223,7 +1323,7 @@
|
||||
@@ -1224,7 +1324,7 @@
|
||||
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
||||
if (this.level() instanceof WorldServer) {
|
||||
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
||||
@@ -230,7 +230,7 @@
|
||||
|
||||
optional.ifPresent((entityinsentient) -> {
|
||||
this.onOffspringSpawnedFromEgg(entityhuman, entityinsentient);
|
||||
@@ -1273,12 +1373,19 @@
|
||||
@@ -1274,12 +1374,19 @@
|
||||
return this.restrictRadius != -1.0F;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
|
||||
if (t0 == null) {
|
||||
return null;
|
||||
@@ -1312,7 +1419,12 @@
|
||||
@@ -1313,7 +1420,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
if (this.isPassenger()) {
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
@@ -1333,7 +1445,8 @@
|
||||
@@ -1334,7 +1446,8 @@
|
||||
|
||||
if (this.leashHolder != null) {
|
||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||
@@ -275,7 +275,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1344,7 +1457,9 @@
|
||||
@@ -1345,7 +1458,9 @@
|
||||
this.leashHolder = null;
|
||||
this.leashInfoTag = null;
|
||||
if (!this.level().isClientSide && flag1) {
|
||||
@@ -285,7 +285,7 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide && flag && this.level() instanceof WorldServer) {
|
||||
@@ -1394,6 +1509,7 @@
|
||||
@@ -1395,6 +1510,7 @@
|
||||
boolean flag1 = super.startRiding(entity, flag);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
@@ -293,7 +293,7 @@
|
||||
this.dropLeash(true, true);
|
||||
}
|
||||
|
||||
@@ -1418,7 +1534,9 @@
|
||||
@@ -1419,7 +1535,9 @@
|
||||
}
|
||||
|
||||
if (this.tickCount > 100) {
|
||||
@@ -303,7 +303,7 @@
|
||||
this.leashInfoTag = null;
|
||||
}
|
||||
}
|
||||
@@ -1500,7 +1618,14 @@
|
||||
@@ -1501,7 +1619,14 @@
|
||||
int i = EnchantmentManager.getFireAspect(this);
|
||||
|
||||
if (i > 0) {
|
||||
@@ -319,7 +319,7 @@
|
||||
}
|
||||
|
||||
boolean flag = entity.hurt(this.damageSources().mobAttack(this), f);
|
||||
@@ -1574,6 +1699,7 @@
|
||||
@@ -1576,6 +1701,7 @@
|
||||
@Override
|
||||
protected void removeAfterChangingDimensions() {
|
||||
super.removeAfterChangingDimensions();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityLightning.java
|
||||
+++ b/net/minecraft/world/entity/EntityLightning.java
|
||||
@@ -29,14 +29,18 @@
|
||||
@@ -29,6 +29,10 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,16 +11,6 @@
|
||||
public class EntityLightning extends Entity {
|
||||
|
||||
private static final int START_LIFE = 2;
|
||||
private static final double DAMAGE_RADIUS = 3.0D;
|
||||
private static final double DETECTION_RADIUS = 15.0D;
|
||||
- private int life;
|
||||
+ public int life; // PAIL private -> public
|
||||
public long seed;
|
||||
- private int flashes;
|
||||
+ public int flashes; // PAIL private -> public
|
||||
public boolean visualOnly;
|
||||
@Nullable
|
||||
private EntityPlayer cause;
|
||||
@@ -129,7 +133,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
public abstract class EntityLiving extends Entity implements Attackable {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -227,6 +251,20 @@
|
||||
@@ -226,6 +250,20 @@
|
||||
private float swimAmountO;
|
||||
protected BehaviorController<?> brain;
|
||||
private boolean skipDropExperience;
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
protected EntityLiving(EntityTypes<? extends EntityLiving> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -239,7 +277,9 @@
|
||||
@@ -238,7 +276,9 @@
|
||||
this.useItem = ItemStack.EMPTY;
|
||||
this.lastClimbablePos = Optional.empty();
|
||||
this.attributes = new AttributeMapBase(AttributeDefaults.getSupplier(entitytypes));
|
||||
@@ -63,7 +63,7 @@
|
||||
this.blocksBuilding = true;
|
||||
this.rotA = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
||||
this.reapplyPosition();
|
||||
@@ -318,7 +358,13 @@
|
||||
@@ -317,7 +357,13 @@
|
||||
double d7 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
int i = (int) (150.0D * d7);
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
}
|
||||
|
||||
super.checkFallDamage(d0, flag, iblockdata, blockposition);
|
||||
@@ -673,13 +719,19 @@
|
||||
@@ -672,13 +718,19 @@
|
||||
}
|
||||
|
||||
public void onEquipItem(EnumItemSlot enumitemslot, ItemStack itemstack, ItemStack itemstack1) {
|
||||
@@ -99,7 +99,7 @@
|
||||
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), equipable.getEquipSound(), this.getSoundSource(), 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -753,6 +805,17 @@
|
||||
@@ -752,6 +804,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
if (nbttagcompound.contains("Health", 99)) {
|
||||
this.setHealth(nbttagcompound.getFloat("Health"));
|
||||
}
|
||||
@@ -790,9 +853,32 @@
|
||||
@@ -789,9 +852,32 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
try {
|
||||
while (iterator.hasNext()) {
|
||||
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
||||
@@ -802,6 +888,12 @@
|
||||
@@ -801,6 +887,12 @@
|
||||
this.onEffectUpdated(mobeffect, true, (Entity) null);
|
||||
})) {
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -163,7 +163,7 @@
|
||||
iterator.remove();
|
||||
this.onEffectRemoved(mobeffect);
|
||||
}
|
||||
@@ -812,6 +904,17 @@
|
||||
@@ -811,6 +903,17 @@
|
||||
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
||||
;
|
||||
}
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
if (this.effectsDirty) {
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -938,7 +1041,13 @@
|
||||
@@ -937,7 +1040,13 @@
|
||||
this.entityData.set(EntityLiving.DATA_EFFECT_COLOR_ID, 0);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
if (this.level().isClientSide) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -947,7 +1056,14 @@
|
||||
@@ -946,7 +1055,14 @@
|
||||
boolean flag;
|
||||
|
||||
for (flag = false; iterator.hasNext(); flag = true) {
|
||||
@@ -211,7 +211,7 @@
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
@@ -976,19 +1092,49 @@
|
||||
@@ -975,19 +1091,49 @@
|
||||
return this.addEffect(mobeffect, (Entity) null);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -1026,13 +1172,39 @@
|
||||
@@ -1025,13 +1171,39 @@
|
||||
return this.getMobType() == EnumMonsterType.UNDEAD;
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
|
||||
if (mobeffect != null) {
|
||||
this.onEffectRemoved(mobeffect);
|
||||
@@ -1130,20 +1302,55 @@
|
||||
@@ -1129,20 +1301,55 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
this.entityData.set(EntityLiving.DATA_HEALTH_ID, MathHelper.clamp(f, 0.0F, this.getMaxHealth()));
|
||||
}
|
||||
|
||||
@@ -1157,7 +1364,7 @@
|
||||
@@ -1156,7 +1363,7 @@
|
||||
return false;
|
||||
} else if (this.level().isClientSide) {
|
||||
return false;
|
||||
@@ -369,7 +369,7 @@
|
||||
return false;
|
||||
} else if (damagesource.is(DamageTypeTags.IS_FIRE) && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
|
||||
return false;
|
||||
@@ -1168,10 +1375,11 @@
|
||||
@@ -1167,10 +1374,11 @@
|
||||
|
||||
this.noActionTime = 0;
|
||||
float f1 = f;
|
||||
@@ -383,7 +383,7 @@
|
||||
this.hurtCurrentlyUsedShield(f);
|
||||
f2 = f;
|
||||
f = 0.0F;
|
||||
@@ -1195,23 +1403,33 @@
|
||||
@@ -1194,23 +1402,33 @@
|
||||
this.walkAnimation.setSpeed(1.5F);
|
||||
boolean flag1 = true;
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
this.hurtHelmet(damagesource, f);
|
||||
f *= 0.75F;
|
||||
}
|
||||
@@ -1329,19 +1547,32 @@
|
||||
@@ -1328,19 +1546,32 @@
|
||||
EnumHand[] aenumhand = EnumHand.values();
|
||||
int i = aenumhand.length;
|
||||
|
||||
@@ -459,7 +459,7 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) this;
|
||||
|
||||
entityplayer.awardStat(StatisticList.ITEM_USED.get(Items.TOTEM_OF_UNDYING));
|
||||
@@ -1350,14 +1581,16 @@
|
||||
@@ -1349,14 +1580,16 @@
|
||||
}
|
||||
|
||||
this.setHealth(1.0F);
|
||||
@@ -481,7 +481,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1466,14 +1699,22 @@
|
||||
@@ -1463,14 +1696,22 @@
|
||||
IBlockData iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||
|
||||
if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
|
||||
@@ -506,7 +506,7 @@
|
||||
this.level().addFreshEntity(entityitem);
|
||||
}
|
||||
}
|
||||
@@ -1493,21 +1734,40 @@
|
||||
@@ -1490,21 +1731,40 @@
|
||||
|
||||
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||
|
||||
@@ -550,7 +550,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1599,6 +1859,28 @@
|
||||
@@ -1596,6 +1856,28 @@
|
||||
return itemstack.getEatingSound();
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
public Optional<BlockPosition> getLastClimbablePos() {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
@@ -1645,9 +1927,14 @@
|
||||
@@ -1642,9 +1924,14 @@
|
||||
int i = this.calculateFallDamage(f, f1);
|
||||
|
||||
if (i > 0) {
|
||||
@@ -595,7 +595,7 @@
|
||||
return true;
|
||||
} else {
|
||||
return flag;
|
||||
@@ -1699,7 +1986,7 @@
|
||||
@@ -1696,7 +1983,7 @@
|
||||
|
||||
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
|
||||
if (!damagesource.is(DamageTypeTags.BYPASSES_ARMOR)) {
|
||||
@@ -604,7 +604,7 @@
|
||||
f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
|
||||
}
|
||||
|
||||
@@ -1712,7 +1999,8 @@
|
||||
@@ -1709,7 +1996,8 @@
|
||||
} else {
|
||||
int i;
|
||||
|
||||
@@ -614,7 +614,7 @@
|
||||
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
||||
int j = 25 - i;
|
||||
float f1 = f * (float) j;
|
||||
@@ -1745,16 +2033,125 @@
|
||||
@@ -1742,16 +2030,125 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
@@ -1765,13 +2162,47 @@
|
||||
@@ -1762,13 +2159,47 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@
|
||||
}
|
||||
|
||||
public CombatTracker getCombatTracker() {
|
||||
@@ -1796,8 +2227,18 @@
|
||||
@@ -1793,8 +2224,18 @@
|
||||
}
|
||||
|
||||
public final void setArrowCount(int i) {
|
||||
@@ -818,7 +818,7 @@
|
||||
|
||||
public final int getStingerCount() {
|
||||
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
||||
@@ -2039,6 +2480,12 @@
|
||||
@@ -2036,6 +2477,12 @@
|
||||
|
||||
public abstract ItemStack getItemBySlot(EnumItemSlot enumitemslot);
|
||||
|
||||
@@ -831,7 +831,7 @@
|
||||
@Override
|
||||
public abstract void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
||||
|
||||
@@ -2273,6 +2720,7 @@
|
||||
@@ -2270,6 +2717,7 @@
|
||||
}
|
||||
|
||||
if (this.onGround() && !this.level().isClientSide) {
|
||||
@@ -839,7 +839,7 @@
|
||||
this.setSharedFlag(7, false);
|
||||
}
|
||||
} else {
|
||||
@@ -2443,7 +2891,7 @@
|
||||
@@ -2440,7 +2888,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@
|
||||
if (this.tickCount % 20 == 0) {
|
||||
this.getCombatTracker().recheckStatus();
|
||||
}
|
||||
@@ -2540,7 +2988,7 @@
|
||||
@@ -2537,7 +2985,7 @@
|
||||
this.refreshDirtyAttributes();
|
||||
}
|
||||
|
||||
@@ -857,7 +857,7 @@
|
||||
Map<EnumItemSlot, ItemStack> map = this.collectEquipmentChanges();
|
||||
|
||||
if (map != null) {
|
||||
@@ -2837,6 +3285,7 @@
|
||||
@@ -2839,6 +3287,7 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -865,7 +865,7 @@
|
||||
this.setSharedFlag(7, flag);
|
||||
}
|
||||
|
||||
@@ -3027,13 +3476,20 @@
|
||||
@@ -3029,13 +3478,20 @@
|
||||
|
||||
@Override
|
||||
public boolean isPickable() {
|
||||
@@ -888,7 +888,7 @@
|
||||
|
||||
@Override
|
||||
public float getYHeadRot() {
|
||||
@@ -3229,7 +3685,26 @@
|
||||
@@ -3231,7 +3687,26 @@
|
||||
} else {
|
||||
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
||||
this.triggerItemUseEffects(this.useItem, 16);
|
||||
@@ -916,7 +916,7 @@
|
||||
|
||||
if (itemstack != this.useItem) {
|
||||
this.setItemInHand(enumhand, itemstack);
|
||||
@@ -3307,6 +3782,12 @@
|
||||
@@ -3309,6 +3784,12 @@
|
||||
}
|
||||
|
||||
public boolean randomTeleport(double d0, double d1, double d2, boolean flag) {
|
||||
@@ -929,7 +929,7 @@
|
||||
double d3 = this.getX();
|
||||
double d4 = this.getY();
|
||||
double d5 = this.getZ();
|
||||
@@ -3331,16 +3812,41 @@
|
||||
@@ -3333,16 +3814,41 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -974,8 +974,8 @@
|
||||
} else {
|
||||
if (flag) {
|
||||
world.broadcastEntityEvent(this, (byte) 46);
|
||||
@@ -3350,7 +3856,7 @@
|
||||
((EntityCreature) this).getNavigation().stop();
|
||||
@@ -3354,7 +3860,7 @@
|
||||
entitycreature.getNavigation().stop();
|
||||
}
|
||||
|
||||
- return true;
|
||||
@@ -983,7 +983,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3439,7 +3945,7 @@
|
||||
@@ -3443,7 +3949,7 @@
|
||||
}
|
||||
|
||||
public void stopSleeping() {
|
||||
@@ -992,7 +992,7 @@
|
||||
World world = this.level();
|
||||
|
||||
java.util.Objects.requireNonNull(world);
|
||||
@@ -3473,7 +3979,7 @@
|
||||
@@ -3477,7 +3983,7 @@
|
||||
|
||||
@Nullable
|
||||
public EnumDirection getBedOrientation() {
|
||||
@@ -1001,7 +1001,7 @@
|
||||
|
||||
return blockposition != null ? BlockBed.getBedOrientation(this.level(), blockposition) : null;
|
||||
}
|
||||
@@ -3521,7 +4027,7 @@
|
||||
@@ -3525,7 +4031,7 @@
|
||||
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
||||
|
||||
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityTypes.java
|
||||
+++ b/net/minecraft/world/entity/EntityTypes.java
|
||||
@@ -158,6 +158,7 @@
|
||||
@@ -160,6 +160,7 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
@@ -8,7 +8,7 @@
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class EntityTypes<T extends Entity> implements FeatureElement, EntityTypeTest<Entity, T> {
|
||||
@@ -168,7 +169,7 @@
|
||||
@@ -170,7 +171,7 @@
|
||||
private static final float MAGIC_HORSE_WIDTH = 1.3964844F;
|
||||
private static final int DISPLAY_TRACKING_RANGE = 10;
|
||||
public static final EntityTypes<Allay> ALLAY = register("allay", EntityTypes.Builder.of(Allay::new, EnumCreatureType.CREATURE).sized(0.35F, 0.6F).clientTrackingRange(8).updateInterval(2));
|
||||
@@ -17,7 +17,7 @@
|
||||
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<Axolotl> AXOLOTL = register("axolotl", EntityTypes.Builder.of(Axolotl::new, EnumCreatureType.AXOLOTLS).sized(0.75F, 0.42F).clientTrackingRange(10));
|
||||
@@ -309,8 +310,8 @@
|
||||
@@ -313,8 +314,8 @@
|
||||
private final EntitySize dimensions;
|
||||
private final FeatureFlagSet requiredFeatures;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
|
||||
public static MinecraftKey getKey(EntityTypes<?> entitytypes) {
|
||||
@@ -338,8 +339,15 @@
|
||||
@@ -342,8 +343,15 @@
|
||||
|
||||
@Nullable
|
||||
public T spawn(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
if (itemstack != null) {
|
||||
nbttagcompound = itemstack.getTag();
|
||||
@@ -350,7 +358,7 @@
|
||||
@@ -354,7 +362,7 @@
|
||||
nbttagcompound = null;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
|
||||
public static <T extends Entity> Consumer<T> createDefaultStackConfig(WorldServer worldserver, ItemStack itemstack, @Nullable EntityHuman entityhuman) {
|
||||
@@ -372,21 +380,37 @@
|
||||
@@ -376,21 +384,37 @@
|
||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
||||
|
||||
return nbttagcompound != null ? consumer.andThen((entity) -> {
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
return t0;
|
||||
@@ -573,7 +597,7 @@
|
||||
@@ -577,7 +601,7 @@
|
||||
}
|
||||
|
||||
return entity;
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
|
||||
public static Stream<Entity> loadEntitiesRecursive(final List<? extends NBTBase> list, final World world) {
|
||||
@@ -634,7 +658,7 @@
|
||||
@@ -638,7 +662,7 @@
|
||||
|
||||
@Nullable
|
||||
public T tryCast(Entity entity) {
|
||||
@@ -113,7 +113,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -669,7 +693,7 @@
|
||||
@@ -673,7 +697,7 @@
|
||||
this.canSpawnFarFromPlayer = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/entity/IEntitySelector.java
|
||||
+++ b/net/minecraft/world/entity/IEntitySelector.java
|
||||
@@ -43,7 +43,7 @@
|
||||
ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
|
||||
@@ -44,7 +44,7 @@
|
||||
ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteam == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteam.getCollisionRule();
|
||||
|
||||
return (Predicate) (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : IEntitySelector.NO_SPECTATORS.and((entity1) -> {
|
||||
- if (!entity1.isPushable()) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
|
||||
@@ -11,6 +11,10 @@
|
||||
import net.minecraft.world.level.pathfinder.PathPoint;
|
||||
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||
import net.minecraft.world.scores.ScoreboardTeam;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityTargetEvent;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ambient/EntityBat.java
|
||||
+++ b/net/minecraft/world/entity/ambient/EntityBat.java
|
||||
@@ -28,6 +28,10 @@
|
||||
@@ -29,6 +29,10 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
+
|
||||
public class EntityBat extends EntityAmbient {
|
||||
|
||||
public static final float FLAP_DEGREES_PER_TICK = 74.48451F;
|
||||
@@ -139,13 +143,13 @@
|
||||
public static final float FLAP_LENGTH_SECONDS = 0.5F;
|
||||
@@ -143,13 +147,13 @@
|
||||
this.yHeadRot = (float) this.random.nextInt(360);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
this.setResting(false);
|
||||
if (!flag) {
|
||||
this.level().levelEvent((EntityHuman) null, 1025, blockposition, 0);
|
||||
@@ -172,7 +176,7 @@
|
||||
@@ -176,7 +180,7 @@
|
||||
|
||||
this.zza = 0.5F;
|
||||
this.setYRot(this.getYRot() + f1);
|
||||
@@ -36,7 +36,7 @@
|
||||
this.setResting(true);
|
||||
}
|
||||
}
|
||||
@@ -197,7 +201,7 @@
|
||||
@@ -201,7 +205,7 @@
|
||||
if (this.isInvulnerableTo(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,10 +182,17 @@
|
||||
@@ -172,10 +184,17 @@
|
||||
}
|
||||
|
||||
public void setInLove(@Nullable EntityHuman entityhuman) {
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
this.level().broadcastEntityEvent(this, (byte) 18);
|
||||
}
|
||||
@@ -215,12 +234,29 @@
|
||||
@@ -217,12 +236,29 @@
|
||||
if (entityageable != null) {
|
||||
entityageable.setBaby(true);
|
||||
entityageable.moveTo(this.getX(), this.getY(), this.getZ(), 0.0F, 0.0F);
|
||||
@@ -86,7 +86,7 @@
|
||||
Optional.ofNullable(this.getLoveCause()).or(() -> {
|
||||
return Optional.ofNullable(entityanimal.getLoveCause());
|
||||
}).ifPresent((entityplayer) -> {
|
||||
@@ -233,7 +269,11 @@
|
||||
@@ -235,7 +271,11 @@
|
||||
entityanimal.resetLove();
|
||||
worldserver.broadcastEntityEvent(this, (byte) 18);
|
||||
if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
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<Integer> MOISTNESS_LEVEL = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.INT);
|
||||
@@ -190,7 +201,7 @@
|
||||
@@ -185,7 +196,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxAirSupply() {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,6 +242,12 @@
|
||||
@@ -226,6 +237,12 @@
|
||||
ItemStack itemstack = entityitem.getItem();
|
||||
|
||||
if (this.canHoldItem(itemstack)) {
|
||||
@@ -42,7 +42,7 @@
|
||||
this.onItemPickup(entityitem);
|
||||
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack);
|
||||
this.setGuaranteedDrop(EnumItemSlot.MAINHAND);
|
||||
@@ -489,7 +506,7 @@
|
||||
@@ -484,7 +501,7 @@
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -508,7 +525,7 @@
|
||||
@@ -503,7 +520,7 @@
|
||||
}
|
||||
|
||||
if (this.player.isSwimming() && this.player.level().random.nextInt(6) == 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
@@ -262,7 +262,7 @@
|
||||
@@ -263,7 +263,7 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -9,7 +9,7 @@
|
||||
this.tame(entityhuman);
|
||||
this.level().broadcastEntityEvent(this, (byte) 7);
|
||||
} else {
|
||||
@@ -276,7 +276,7 @@
|
||||
@@ -277,7 +277,7 @@
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
||||
this.hurt(this.damageSources().playerAttack(entityhuman), Float.MAX_VALUE);
|
||||
}
|
||||
@@ -383,7 +383,7 @@
|
||||
@@ -384,7 +384,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -398,11 +398,14 @@
|
||||
@@ -399,11 +399,14 @@
|
||||
if (this.isInvulnerableTo(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||
@@ -312,7 +312,9 @@
|
||||
@@ -307,7 +307,9 @@
|
||||
protected void ageBoundaryReached() {
|
||||
super.ageBoundaryReached();
|
||||
if (!this.isBaby() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -339,7 +341,9 @@
|
||||
@@ -334,7 +336,9 @@
|
||||
|
||||
@Override
|
||||
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -496,12 +500,14 @@
|
||||
@@ -491,12 +495,14 @@
|
||||
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
|
||||
World world = this.turtle.level();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -414,7 +421,7 @@
|
||||
@@ -409,7 +416,7 @@
|
||||
int i = mobeffect != null ? mobeffect.getDuration() : 0;
|
||||
int j = Math.min(2400, 100 + i);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
|
||||
@@ -464,7 +471,7 @@
|
||||
@@ -459,7 +466,7 @@
|
||||
|
||||
@Override
|
||||
public BehaviorController<Axolotl> getBrain() {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -591,7 +598,7 @@
|
||||
@@ -588,7 +595,7 @@
|
||||
super.aiStep();
|
||||
if (!this.level().isClientSide && this.isAlive()) {
|
||||
if (this.random.nextInt(900) == 0 && this.deathTime == 0) {
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
if (this.canEatGrass()) {
|
||||
@@ -858,6 +865,7 @@
|
||||
@@ -855,6 +862,7 @@
|
||||
if (this.getOwnerUUID() != null) {
|
||||
nbttagcompound.putUUID("Owner", this.getOwnerUUID());
|
||||
}
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
if (!this.inventory.getItem(0).isEmpty()) {
|
||||
nbttagcompound.put("SaddleItem", this.inventory.getItem(0).save(new NBTTagCompound()));
|
||||
@@ -885,6 +893,11 @@
|
||||
@@ -882,6 +890,11 @@
|
||||
if (uuid != null) {
|
||||
this.setOwnerUUID(uuid);
|
||||
}
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
if (nbttagcompound.contains("SaddleItem", 10)) {
|
||||
ItemStack itemstack = ItemStack.of(nbttagcompound.getCompound("SaddleItem"));
|
||||
@@ -987,6 +1000,17 @@
|
||||
@@ -984,6 +997,17 @@
|
||||
|
||||
@Override
|
||||
public void handleStartJump(int i) {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
this.noPhysics = true;
|
||||
this.noCulling = true;
|
||||
this.phaseManager = new DragonControllerManager(this);
|
||||
+ this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY); // CraftBukkit
|
||||
+ this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY, Particles.EXPLOSION, Particles.EXPLOSION_EMITTER, SoundEffects.GENERIC_EXPLODE); // CraftBukkit
|
||||
}
|
||||
|
||||
public void setDragonFight(EnderDragonBattle enderdragonbattle) {
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
if (damagesource.is(DamageTypeTags.IS_EXPLOSION)) {
|
||||
this.brokenByAnything(damagesource);
|
||||
this.kill();
|
||||
@@ -486,7 +538,7 @@
|
||||
@@ -473,7 +525,7 @@
|
||||
} else {
|
||||
this.brokenByPlayer(damagesource);
|
||||
this.showBreakingParticles();
|
||||
@@ -117,7 +117,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -554,13 +606,13 @@
|
||||
@@ -541,13 +593,13 @@
|
||||
itemstack.setHoverName(this.getCustomName());
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
ItemStack itemstack;
|
||||
int i;
|
||||
@@ -568,7 +620,7 @@
|
||||
@@ -555,7 +607,7 @@
|
||||
for (i = 0; i < this.handItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.handItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -142,7 +142,7 @@
|
||||
this.handItems.set(i, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
@@ -576,10 +628,11 @@
|
||||
@@ -563,10 +615,11 @@
|
||||
for (i = 0; i < this.armorItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.armorItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -675,8 +728,16 @@
|
||||
@@ -662,8 +715,16 @@
|
||||
return this.isSmall();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
@Override
|
||||
public boolean survives() {
|
||||
@@ -173,6 +185,11 @@
|
||||
@@ -168,6 +180,11 @@
|
||||
return false;
|
||||
} else if (!damagesource.is(DamageTypeTags.IS_EXPLOSION) && !this.getItem().isEmpty()) {
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -60,7 +60,7 @@
|
||||
this.dropItem(damagesource.getEntity(), false);
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, damagesource.getEntity());
|
||||
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
|
||||
@@ -302,13 +319,19 @@
|
||||
@@ -297,13 +314,19 @@
|
||||
}
|
||||
|
||||
public void setItem(ItemStack itemstack, boolean flag) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class EntityItem extends Entity implements TraceableEntity {
|
||||
|
||||
private static final DataWatcherObject<ItemStack> DATA_ITEM = DataWatcher.defineId(EntityItem.class, DataWatcherRegistry.ITEM_STACK);
|
||||
@@ -45,6 +53,7 @@
|
||||
@@ -47,6 +55,7 @@
|
||||
@Nullable
|
||||
public UUID target;
|
||||
public final float bobOffs;
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -110,9 +119,12 @@
|
||||
@@ -128,9 +137,12 @@
|
||||
this.discard();
|
||||
} else {
|
||||
super.tick();
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
this.xo = this.getX();
|
||||
this.yo = this.getY();
|
||||
@@ -162,9 +174,11 @@
|
||||
@@ -180,9 +192,11 @@
|
||||
this.mergeWithNeighbours();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
this.hasImpulse |= this.updateInWaterStateAndDoFluidPushing();
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -176,6 +190,12 @@
|
||||
@@ -194,6 +208,12 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide && this.age >= 6000) {
|
||||
@@ -64,7 +64,7 @@
|
||||
this.discard();
|
||||
}
|
||||
|
||||
@@ -259,6 +279,11 @@
|
||||
@@ -277,6 +297,11 @@
|
||||
}
|
||||
|
||||
private static void merge(EntityItem entityitem, ItemStack itemstack, EntityItem entityitem1, ItemStack itemstack1) {
|
||||
@@ -76,7 +76,7 @@
|
||||
merge(entityitem, itemstack, itemstack1);
|
||||
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
|
||||
entityitem.age = Math.min(entityitem.age, entityitem1.age);
|
||||
@@ -284,6 +309,11 @@
|
||||
@@ -302,6 +327,11 @@
|
||||
} else if (this.level().isClientSide) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -88,7 +88,7 @@
|
||||
this.markHurt();
|
||||
this.health = (int) ((float) this.health - f);
|
||||
this.gameEvent(GameEvent.ENTITY_DAMAGE, damagesource.getEntity());
|
||||
@@ -347,6 +377,46 @@
|
||||
@@ -366,6 +396,46 @@
|
||||
Item item = itemstack.getItem();
|
||||
int i = itemstack.getCount();
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/item/EntityTNTPrimed.java
|
||||
+++ b/net/minecraft/world/entity/item/EntityTNTPrimed.java
|
||||
@@ -15,12 +15,19 @@
|
||||
import net.minecraft.world.entity.TraceableEntity;
|
||||
import net.minecraft.world.level.World;
|
||||
@@ -19,6 +19,11 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
+// CraftBukkit start;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -12,7 +12,8 @@
|
||||
public class EntityTNTPrimed extends Entity implements TraceableEntity {
|
||||
|
||||
private static final DataWatcherObject<Integer> DATA_FUSE_ID = DataWatcher.defineId(EntityTNTPrimed.class, DataWatcherRegistry.INT);
|
||||
private static final int DEFAULT_FUSE_TIME = 80;
|
||||
@@ -28,6 +33,8 @@
|
||||
public static final String TAG_FUSE = "fuse";
|
||||
@Nullable
|
||||
public EntityLiving owner;
|
||||
+ public float yield = 4; // CraftBukkit - add field
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -71,10 +78,13 @@
|
||||
@@ -79,10 +86,13 @@
|
||||
|
||||
this.setFuse(i);
|
||||
if (i <= 0) {
|
||||
@@ -35,7 +36,7 @@
|
||||
} else {
|
||||
this.updateInWaterStateAndDoFluidPushing();
|
||||
if (this.level().isClientSide) {
|
||||
@@ -85,9 +95,14 @@
|
||||
@@ -93,9 +103,14 @@
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityEvoker.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityEvoker.java
|
||||
@@ -194,7 +194,7 @@
|
||||
entityvex.setOwner(EntityEvoker.this);
|
||||
entityvex.setBoundOrigin(blockposition);
|
||||
entityvex.setLimitedLife(20 * (30 + EntityEvoker.this.random.nextInt(90)));
|
||||
@@ -200,7 +200,7 @@
|
||||
worldserver.getScoreboard().addPlayerToTeam(entityvex.getScoreboardName(), scoreboardteam);
|
||||
}
|
||||
|
||||
- worldserver.addFreshEntityWithPassengers(entityvex);
|
||||
+ worldserver.addFreshEntityWithPassengers(entityvex, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPELL); // CraftBukkit - Add SpawnReason
|
||||
worldserver.gameEvent(GameEvent.ENTITY_PLACE, blockposition, GameEvent.a.of((Entity) EntityEvoker.this));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityVex.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityVex.java
|
||||
@@ -393,7 +393,7 @@
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -372,7 +372,7 @@
|
||||
@@ -373,7 +373,7 @@
|
||||
|
||||
@Override
|
||||
public BehaviorController<Warden> getBrain() {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -413,13 +413,13 @@
|
||||
@@ -414,13 +414,13 @@
|
||||
public static void applyDarknessAround(WorldServer worldserver, Vec3D vec3d, @Nullable Entity entity, int i) {
|
||||
MobEffect mobeffect = new MobEffect(MobEffects.DARKNESS, 260, 0, false, false);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
Logger logger = Warden.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -444,7 +444,7 @@
|
||||
@@ -445,7 +445,7 @@
|
||||
dataresult = AngerManagement.codec(this::canTargetEntity).parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("anger")));
|
||||
logger = Warden.LOGGER;
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -34,7 +34,7 @@
|
||||
this.angerManagement = angermanagement;
|
||||
});
|
||||
this.syncClientAngerLevel();
|
||||
@@ -454,7 +454,7 @@
|
||||
@@ -455,7 +455,7 @@
|
||||
dataresult = VibrationSystem.a.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("listener")));
|
||||
logger = Warden.LOGGER;
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -43,7 +43,7 @@
|
||||
this.vibrationData = vibrationsystem_a;
|
||||
});
|
||||
}
|
||||
@@ -488,7 +488,7 @@
|
||||
@@ -489,7 +489,7 @@
|
||||
public void increaseAngerAt(@Nullable Entity entity, int i, boolean flag) {
|
||||
if (!this.isNoAi() && this.canTargetEntity(entity)) {
|
||||
WardenAi.setDigCooldown(this);
|
||||
@@ -52,7 +52,7 @@
|
||||
int j = this.angerManagement.increaseAnger(entity, i);
|
||||
|
||||
if (entity instanceof EntityHuman && flag1 && AngerLevel.byAnger(j).isAngry()) {
|
||||
@@ -509,7 +509,7 @@
|
||||
@@ -510,7 +510,7 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public EntityLiving getTarget() {
|
||||
@@ -61,7 +61,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -552,7 +552,7 @@
|
||||
@@ -553,7 +553,7 @@
|
||||
|
||||
public void setAttackTarget(EntityLiving entityliving) {
|
||||
this.getBrain().eraseMemory(MemoryModuleType.ROAR_TARGET);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -117,6 +117,20 @@
|
||||
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||
@@ -112,6 +112,20 @@
|
||||
import net.minecraft.world.scores.ScoreboardTeam;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -21,17 +21,17 @@
|
||||
public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -132,7 +146,8 @@
|
||||
@@ -127,7 +141,8 @@
|
||||
public static final float SWIMMING_BB_HEIGHT = 0.6F;
|
||||
public static final float DEFAULT_EYE_HEIGHT = 1.62F;
|
||||
public static final EntitySize STANDING_DIMENSIONS = EntitySize.scalable(0.6F, 1.8F);
|
||||
- private static final Map<EntityPose, EntitySize> POSES = ImmutableMap.builder().put(EntityPose.STANDING, EntityHuman.STANDING_DIMENSIONS).put(EntityPose.SLEEPING, EntityHuman.SLEEPING_DIMENSIONS).put(EntityPose.FALL_FLYING, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.scalable(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.fixed(0.2F, 0.2F)).build();
|
||||
+ // CraftBukkit - decompile error
|
||||
+ private static final Map<EntityPose, EntitySize> POSES = ImmutableMap.<EntityPose, EntitySize>builder().put(EntityPose.STANDING, EntityHuman.STANDING_DIMENSIONS).put(EntityPose.SLEEPING, EntityHuman.SLEEPING_DIMENSIONS).put(EntityPose.FALL_FLYING, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.scalable(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.scalable(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.fixed(0.2F, 0.2F)).build();
|
||||
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<Integer> DATA_SCORE_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.INT);
|
||||
@@ -142,10 +157,10 @@
|
||||
protected static final DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.BYTE);
|
||||
@@ -136,10 +151,10 @@
|
||||
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
|
||||
private long timeEntitySatOnShoulder;
|
||||
private final PlayerInventory inventory = new PlayerInventory(this);
|
||||
@@ -44,7 +44,7 @@
|
||||
protected int jumpTriggerTime;
|
||||
public float oBob;
|
||||
public float bob;
|
||||
@@ -174,6 +189,16 @@
|
||||
@@ -168,6 +183,16 @@
|
||||
public EntityFishingHook fishing;
|
||||
protected float hurtDir;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.lastItemInMainHand = ItemStack.EMPTY;
|
||||
@@ -313,7 +338,7 @@
|
||||
@@ -312,7 +337,7 @@
|
||||
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
|
||||
|
||||
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -483,8 +508,14 @@
|
||||
@@ -482,8 +507,14 @@
|
||||
public void rideTick() {
|
||||
if (!this.level().isClientSide && this.wantsToStopRiding() && this.isPassenger()) {
|
||||
this.stopRiding();
|
||||
@@ -84,10 +84,10 @@
|
||||
+ }
|
||||
+ {
|
||||
+ // CraftBukkit end
|
||||
double d0 = this.getX();
|
||||
double d1 = this.getY();
|
||||
double d2 = this.getZ();
|
||||
@@ -511,7 +542,8 @@
|
||||
super.rideTick();
|
||||
this.oBob = this.bob;
|
||||
this.bob = 0.0F;
|
||||
@@ -505,7 +536,8 @@
|
||||
|
||||
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL && this.level().getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
|
||||
if (this.getHealth() < this.getMaxHealth() && this.tickCount % 20 == 0) {
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
if (this.foodData.needsFood() && this.tickCount % 10 == 0) {
|
||||
@@ -671,6 +703,13 @@
|
||||
@@ -665,6 +697,13 @@
|
||||
|
||||
@Nullable
|
||||
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
|
||||
@@ -111,7 +111,7 @@
|
||||
if (itemstack.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -705,6 +744,33 @@
|
||||
@@ -699,6 +738,33 @@
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
return entityitem;
|
||||
}
|
||||
}
|
||||
@@ -795,7 +861,7 @@
|
||||
@@ -789,7 +855,7 @@
|
||||
}
|
||||
|
||||
if (nbttagcompound.contains("LastDeathLocation", 10)) {
|
||||
@@ -154,7 +154,7 @@
|
||||
Logger logger = EntityHuman.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -828,7 +894,7 @@
|
||||
@@ -822,7 +888,7 @@
|
||||
}
|
||||
|
||||
this.getLastDeathLocation().flatMap((globalpos) -> {
|
||||
@@ -163,7 +163,7 @@
|
||||
Logger logger = EntityHuman.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -855,12 +921,12 @@
|
||||
@@ -849,12 +915,12 @@
|
||||
return false;
|
||||
} else {
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -178,7 +178,7 @@
|
||||
}
|
||||
|
||||
if (this.level().getDifficulty() == EnumDifficulty.EASY) {
|
||||
@@ -872,7 +938,13 @@
|
||||
@@ -866,7 +932,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -892,10 +964,29 @@
|
||||
@@ -886,10 +958,29 @@
|
||||
}
|
||||
|
||||
public boolean canHarmPlayer(EntityHuman entityhuman) {
|
||||
- ScoreboardTeamBase scoreboardteambase = this.getTeam();
|
||||
- ScoreboardTeamBase scoreboardteambase1 = entityhuman.getTeam();
|
||||
- ScoreboardTeam scoreboardteam = this.getTeam();
|
||||
- ScoreboardTeam scoreboardteam1 = entityhuman.getTeam();
|
||||
+ // CraftBukkit start - Change to check OTHER player's scoreboard team according to API
|
||||
+ // To summarize this method's logic, it's "Can parameter hurt this"
|
||||
+ org.bukkit.scoreboard.Team team;
|
||||
@@ -217,7 +217,7 @@
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- return scoreboardteambase == null ? true : (!scoreboardteambase.isAlliedTo(scoreboardteambase1) ? true : scoreboardteambase.isAllowFriendlyFire());
|
||||
- return scoreboardteam == null ? true : (!scoreboardteam.isAlliedTo(scoreboardteam1) ? true : scoreboardteam.isAllowFriendlyFire());
|
||||
+ if (this instanceof EntityPlayer) {
|
||||
+ return !team.hasPlayer(((EntityPlayer) this).getBukkitEntity());
|
||||
+ }
|
||||
@@ -226,7 +226,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -937,8 +1028,13 @@
|
||||
@@ -931,8 +1022,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
if (!this.isInvulnerableTo(damagesource)) {
|
||||
f = this.getDamageAfterArmorAbsorb(damagesource, f);
|
||||
f = this.getDamageAfterMagicAbsorb(damagesource, f);
|
||||
@@ -953,7 +1049,7 @@
|
||||
@@ -947,7 +1043,7 @@
|
||||
}
|
||||
|
||||
if (f != 0.0F) {
|
||||
@@ -250,7 +250,7 @@
|
||||
this.getCombatTracker().recordDamage(damagesource, f);
|
||||
this.setHealth(this.getHealth() - f);
|
||||
if (f < 3.4028235E37F) {
|
||||
@@ -963,6 +1059,7 @@
|
||||
@@ -957,6 +1053,7 @@
|
||||
this.gameEvent(GameEvent.ENTITY_DAMAGE);
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1127,7 +1224,7 @@
|
||||
@@ -1121,7 +1218,7 @@
|
||||
|
||||
f *= 0.2F + f2 * f2 * 0.8F;
|
||||
f1 *= f2;
|
||||
@@ -267,7 +267,7 @@
|
||||
if (f > 0.0F || f1 > 0.0F) {
|
||||
boolean flag = f2 > 0.9F;
|
||||
boolean flag1 = false;
|
||||
@@ -1166,8 +1263,15 @@
|
||||
@@ -1160,8 +1257,15 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
f3 = ((EntityLiving) entity).getHealth();
|
||||
if (j > 0 && !entity.isOnFire()) {
|
||||
@@ -285,7 +285,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1195,8 +1299,11 @@
|
||||
@@ -1189,8 +1293,11 @@
|
||||
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) {
|
||||
@@ -298,7 +298,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1205,9 +1312,26 @@
|
||||
@@ -1199,9 +1306,26 @@
|
||||
}
|
||||
|
||||
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
||||
@@ -325,7 +325,7 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -1252,7 +1376,14 @@
|
||||
@@ -1246,7 +1370,14 @@
|
||||
|
||||
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
||||
if (j > 0) {
|
||||
@@ -341,7 +341,7 @@
|
||||
}
|
||||
|
||||
if (this.level() instanceof WorldServer && f5 > 2.0F) {
|
||||
@@ -1262,12 +1393,17 @@
|
||||
@@ -1256,12 +1387,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1344,6 +1480,12 @@
|
||||
@@ -1338,6 +1474,12 @@
|
||||
}
|
||||
|
||||
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
|
||||
@@ -373,7 +373,7 @@
|
||||
this.startSleeping(blockposition);
|
||||
this.sleepCounter = 0;
|
||||
return Either.right(Unit.INSTANCE);
|
||||
@@ -1431,9 +1573,9 @@
|
||||
@@ -1425,9 +1567,9 @@
|
||||
super.jumpFromGround();
|
||||
this.awardStat(StatisticList.JUMP);
|
||||
if (this.isSprinting()) {
|
||||
@@ -385,9 +385,9 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1463,7 +1605,11 @@
|
||||
@@ -1454,7 +1596,11 @@
|
||||
|
||||
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
||||
this.setDeltaMovement(vec3d2.x, d0 * 0.6D, vec3d2.z);
|
||||
this.resetFallDistance();
|
||||
- this.setSharedFlag(7, false);
|
||||
+ // CraftBukkit start
|
||||
@@ -398,47 +398,7 @@
|
||||
} else {
|
||||
super.travel(vec3d);
|
||||
}
|
||||
@@ -1498,19 +1644,19 @@
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.SWIM_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.SWIM); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.isEyeInFluid(TagsFluid.WATER)) {
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.WALK_UNDER_WATER_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK_UNDERWATER); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.isInWater()) {
|
||||
i = Math.round((float) Math.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.awardStat(StatisticList.WALK_ON_WATER_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.01F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.01F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK_ON_WATER); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
} else if (this.onClimbable()) {
|
||||
if (d1 > 0.0D) {
|
||||
@@ -1521,13 +1667,13 @@
|
||||
if (i > 0) {
|
||||
if (this.isSprinting()) {
|
||||
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.1F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.1F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.SPRINT); // CraftBukkit - EntityExhaustionEvent
|
||||
} else if (this.isCrouching()) {
|
||||
this.awardStat(StatisticList.CROUCH_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.0F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.0F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.CROUCH); // CraftBukkit - EntityExhaustionEvent
|
||||
} else {
|
||||
this.awardStat(StatisticList.WALK_ONE_CM, i);
|
||||
- this.causeFoodExhaustion(0.0F * (float) i * 0.01F);
|
||||
+ this.causeFoodExhaustion(0.0F * (float) i * 0.01F, EntityExhaustionEvent.ExhaustionReason.WALK); // CraftBukkit - EntityExhaustionEvent
|
||||
}
|
||||
}
|
||||
} else if (this.isFallFlying()) {
|
||||
@@ -1593,12 +1739,24 @@
|
||||
@@ -1507,12 +1653,24 @@
|
||||
}
|
||||
|
||||
public void startFallFlying() {
|
||||
@@ -464,7 +424,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1712,10 +1870,21 @@
|
||||
@@ -1626,10 +1784,21 @@
|
||||
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
||||
}
|
||||
|
||||
@@ -487,7 +447,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1801,13 +1970,20 @@
|
||||
@@ -1715,13 +1884,20 @@
|
||||
|
||||
@Override
|
||||
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
@@ -511,7 +471,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1846,26 +2022,31 @@
|
||||
@@ -1760,26 +1936,31 @@
|
||||
|
||||
protected void removeEntitiesOnShoulder() {
|
||||
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
@@ -46,6 +46,12 @@
|
||||
@@ -47,6 +47,12 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
private static final double ARROW_BASE_DAMAGE = 2.0D;
|
||||
@@ -212,7 +218,7 @@
|
||||
@@ -219,7 +225,7 @@
|
||||
}
|
||||
|
||||
if (object != null && !flag) {
|
||||
@@ -22,10 +22,10 @@
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
|
||||
@@ -359,7 +365,13 @@
|
||||
int k = entity.getRemainingFireTicks();
|
||||
@@ -367,7 +373,13 @@
|
||||
boolean flag1 = entity.getType().is(TagsEntity.DEFLECTS_ARROWS);
|
||||
|
||||
if (this.isOnFire() && !flag) {
|
||||
if (this.isOnFire() && !flag && !flag1) {
|
||||
- entity.setSecondsOnFire(5);
|
||||
+ // CraftBukkit start
|
||||
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
if (entity.hurt(damagesource, (float) i)) {
|
||||
@@ -522,7 +534,22 @@
|
||||
@@ -545,7 +557,22 @@
|
||||
@Override
|
||||
public void playerTouch(EntityHuman entityhuman) {
|
||||
if (!this.level().isClientSide && (this.inGround || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
@@ -15,6 +15,13 @@
|
||||
@@ -18,6 +18,13 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class EntityEnderPearl extends EntityProjectileThrowable {
|
||||
|
||||
public EntityEnderPearl(EntityTypes<? extends EntityEnderPearl> entitytypes, World world) {
|
||||
@@ -51,23 +58,36 @@
|
||||
@@ -54,23 +61,36 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
|
||||
if (entityplayer.connection.isAcceptingMessages() && entityplayer.level() == this.level() && !entityplayer.isSleeping()) {
|
||||
@@ -61,10 +61,10 @@
|
||||
+ CraftEventFactory.entityDamage = null;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), SoundEffects.PLAYER_TELEPORT, SoundCategory.PLAYERS);
|
||||
}
|
||||
} else if (entity != null) {
|
||||
entity.teleportTo(this.getX(), this.getY(), this.getZ());
|
||||
@@ -96,7 +116,7 @@
|
||||
@@ -100,7 +120,7 @@
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
@@ -19,7 +19,7 @@
|
||||
public static final int ATTACK_DURATION = 20;
|
||||
public static final int LIFE_OFFSET = 2;
|
||||
public static final int ATTACK_TRIGGER_TICKS = 14;
|
||||
- private int warmupDelayTicks;
|
||||
+ public int warmupDelayTicks;
|
||||
private boolean sentSpikeEvent;
|
||||
private int lifeTicks;
|
||||
private boolean clientSideAttackStarted;
|
||||
@@ -129,7 +129,9 @@
|
||||
|
||||
if (entityliving.isAlive() && !entityliving.isInvulnerable() && entityliving != entityliving1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
@@ -15,11 +15,15 @@
|
||||
@@ -17,11 +17,15 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -29,6 +33,12 @@
|
||||
@@ -36,6 +40,12 @@
|
||||
this(entitytypes, world);
|
||||
this.moveTo(d0, d1, d2, this.getYRot(), this.getXRot());
|
||||
this.reapplyPosition();
|
||||
@@ -29,8 +29,8 @@
|
||||
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||
|
||||
if (d6 != 0.0D) {
|
||||
@@ -75,7 +85,13 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
@@ -86,7 +96,13 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
- this.onHit(movingobjectposition);
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
this.checkInsideBlocks();
|
||||
@@ -161,6 +177,11 @@
|
||||
@@ -184,6 +200,11 @@
|
||||
|
||||
if (entity != null) {
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
@@ -45,7 +45,7 @@
|
||||
@@ -41,7 +41,7 @@
|
||||
super.doPostHurtEffects(entityliving);
|
||||
MobEffect mobeffect = new MobEffect(MobEffects.GLOWING, this.duration, 0);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
@@ -157,7 +157,7 @@
|
||||
@@ -153,7 +153,7 @@
|
||||
if (entitylightning != null) {
|
||||
entitylightning.moveTo(Vec3D.atBottomCenterOf(blockposition));
|
||||
entitylightning.setCause(entity1 instanceof EntityPlayer ? (EntityPlayer) entity1 : null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
@@ -212,7 +212,7 @@
|
||||
@@ -213,7 +213,7 @@
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
entityliving.addEffect(new MobEffect(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
|
||||
return i / 8;
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
if (!this.effects.isEmpty()) {
|
||||
@@ -220,7 +220,7 @@
|
||||
@@ -221,7 +221,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
@@ -20,6 +20,10 @@
|
||||
@@ -21,6 +21,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityWitherSkull extends EntityFireball {
|
||||
|
||||
private static final DataWatcherObject<Boolean> DATA_DANGEROUS = DataWatcher.defineId(EntityWitherSkull.class, DataWatcherRegistry.BOOLEAN);
|
||||
@@ -63,7 +67,7 @@
|
||||
@@ -64,7 +68,7 @@
|
||||
if (entity.isAlive()) {
|
||||
this.doEnchantDamageEffects(entityliving, entity);
|
||||
} else {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -81,7 +85,7 @@
|
||||
@@ -82,7 +86,7 @@
|
||||
}
|
||||
|
||||
if (b0 > 0) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +96,15 @@
|
||||
@@ -93,7 +97,15 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
@@ -24,6 +24,10 @@
|
||||
@@ -25,6 +25,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public abstract class IProjectile extends Entity implements TraceableEntity {
|
||||
|
||||
@Nullable
|
||||
@@ -33,6 +37,10 @@
|
||||
@@ -34,6 +38,10 @@
|
||||
private boolean leftOwner;
|
||||
private boolean hasBeenShot;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
}
|
||||
@@ -42,6 +50,7 @@
|
||||
@@ -43,6 +51,7 @@
|
||||
this.ownerUUID = entity.getUUID();
|
||||
this.cachedOwner = entity;
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -147,6 +156,16 @@
|
||||
@@ -167,6 +176,16 @@
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, entity.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
MovingObjectPosition.EnumMovingObjectType movingobjectposition_enummovingobjecttype = movingobjectposition.getType();
|
||||
|
||||
@@ -167,6 +186,11 @@
|
||||
@@ -187,6 +206,11 @@
|
||||
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {}
|
||||
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
public class ChestBoat extends EntityBoat implements HasCustomInventoryScreen, ContainerEntity {
|
||||
|
||||
@@ -237,4 +244,51 @@
|
||||
@@ -238,4 +245,51 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.a.of((Entity) entityhuman));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/EntityBoat.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/EntityBoat.java
|
||||
@@ -55,6 +55,16 @@
|
||||
@@ -55,6 +55,15 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
@@ -8,16 +8,15 @@
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
+import org.bukkit.entity.Vehicle;
|
||||
+import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleMoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntityBoat extends Entity implements VariantHolder<EntityBoat.EnumBoatType> {
|
||||
public class EntityBoat extends VehicleEntity implements VariantHolder<EntityBoat.EnumBoatType> {
|
||||
|
||||
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityBoat.class, DataWatcherRegistry.INT);
|
||||
@@ -95,6 +105,14 @@
|
||||
private static final DataWatcherObject<Integer> DATA_ID_TYPE = DataWatcher.defineId(EntityBoat.class, DataWatcherRegistry.INT);
|
||||
@@ -92,6 +101,14 @@
|
||||
private float bubbleAngle;
|
||||
private float bubbleAngleO;
|
||||
|
||||
@@ -32,43 +31,7 @@
|
||||
public EntityBoat(EntityTypes<? extends EntityBoat> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.paddlePositions = new float[2];
|
||||
@@ -180,6 +198,19 @@
|
||||
if (this.isInvulnerableTo(damagesource)) {
|
||||
return false;
|
||||
} else if (!this.level().isClientSide && !this.isRemoved()) {
|
||||
+ // CraftBukkit start
|
||||
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
+ org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
+
|
||||
+ VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // f = event.getDamage(); // TODO Why don't we do this?
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.setHurtDir(-this.getHurtDir());
|
||||
this.setHurtTime(10);
|
||||
this.setDamage(this.getDamage() + f * 10.0F);
|
||||
@@ -188,6 +219,15 @@
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
||||
|
||||
if (flag || this.getDamage() > 40.0F) {
|
||||
+ // CraftBukkit start
|
||||
+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(destroyEvent);
|
||||
+
|
||||
+ if (destroyEvent.isCancelled()) {
|
||||
+ this.setDamage(40F); // Maximize damage so this doesn't get triggered again right away
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (!flag && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||
this.destroy(damagesource);
|
||||
}
|
||||
@@ -227,9 +267,29 @@
|
||||
@@ -192,9 +209,29 @@
|
||||
public void push(Entity entity) {
|
||||
if (entity instanceof EntityBoat) {
|
||||
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
|
||||
@@ -98,7 +61,7 @@
|
||||
super.push(entity);
|
||||
}
|
||||
|
||||
@@ -322,6 +382,7 @@
|
||||
@@ -288,6 +325,7 @@
|
||||
return this.getDirection().getClockWise();
|
||||
}
|
||||
|
||||
@@ -106,7 +69,7 @@
|
||||
@Override
|
||||
public void tick() {
|
||||
this.oldStatus = this.status;
|
||||
@@ -362,6 +423,22 @@
|
||||
@@ -328,6 +366,22 @@
|
||||
this.setDeltaMovement(Vec3D.ZERO);
|
||||
}
|
||||
|
||||
@@ -129,7 +92,7 @@
|
||||
this.tickBubbleColumn();
|
||||
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
@@ -845,6 +922,11 @@
|
||||
@@ -813,6 +867,11 @@
|
||||
|
||||
this.causeFallDamage(this.fallDistance, 1.0F, this.damageSources().fall());
|
||||
if (!this.level().isClientSide && !this.isRemoved()) {
|
||||
@@ -141,7 +104,7 @@
|
||||
this.kill();
|
||||
if (this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||
int i;
|
||||
@@ -858,6 +940,7 @@
|
||||
@@ -826,6 +885,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
@@ -50,6 +50,16 @@
|
||||
@@ -48,6 +48,14 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
+import org.bukkit.entity.Vehicle;
|
||||
+import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
|
||||
+import org.bukkit.util.Vector;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class EntityMinecartAbstract extends Entity {
|
||||
public abstract class EntityMinecartAbstract extends VehicleEntity {
|
||||
|
||||
private static final float LOWERED_PASSENGER_ATTACHMENT_Y = 0.0F;
|
||||
@@ -93,6 +103,17 @@
|
||||
@@ -88,6 +96,17 @@
|
||||
enummap.put(BlockPropertyTrackPosition.NORTH_EAST, Pair.of(baseblockposition2, baseblockposition1));
|
||||
});
|
||||
|
||||
@@ -35,43 +33,16 @@
|
||||
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.targetDeltaMovement = Vec3D.ZERO;
|
||||
@@ -222,6 +243,19 @@
|
||||
if (this.isInvulnerableTo(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
+ // CraftBukkit start - fire VehicleDamageEvent
|
||||
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
+ org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
+
|
||||
+ VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, f);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ f = (float) event.getDamage();
|
||||
+ // CraftBukkit end
|
||||
this.setHurtDir(-this.getHurtDir());
|
||||
this.setHurtTime(10);
|
||||
this.markHurt();
|
||||
@@ -230,6 +264,15 @@
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
|
||||
@@ -128,7 +147,7 @@
|
||||
object = new EntityMinecartRideable(worldserver, d0, d1, d2);
|
||||
}
|
||||
|
||||
if (flag || this.getDamage() > 40.0F) {
|
||||
+ // CraftBukkit start
|
||||
+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(destroyEvent);
|
||||
+
|
||||
+ if (destroyEvent.isCancelled()) {
|
||||
+ this.setDamage(40); // Maximize damage so this doesn't get triggered again right away
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.ejectPassengers();
|
||||
if (flag && !this.hasCustomName()) {
|
||||
this.discard();
|
||||
@@ -291,6 +334,14 @@
|
||||
- Object object1 = object;
|
||||
+ EntityMinecartAbstract object1 = (EntityMinecartAbstract) object; // CraftBukkit- decompile error
|
||||
|
||||
EntityTypes.createDefaultStackConfig(worldserver, itemstack, entityhuman).accept(object1);
|
||||
return (EntityMinecartAbstract) object1;
|
||||
@@ -267,6 +286,14 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -86,7 +57,7 @@
|
||||
if (this.getHurtTime() > 0) {
|
||||
this.setHurtTime(this.getHurtTime() - 1);
|
||||
}
|
||||
@@ -300,7 +351,7 @@
|
||||
@@ -276,7 +303,7 @@
|
||||
}
|
||||
|
||||
this.checkBelowWorld();
|
||||
@@ -95,7 +66,7 @@
|
||||
if (this.level().isClientSide) {
|
||||
if (this.lerpSteps > 0) {
|
||||
this.lerpPositionAndRotationStep(this.lerpSteps, this.lerpX, this.lerpY, this.lerpZ, this.lerpYRot, this.lerpXRot);
|
||||
@@ -358,6 +409,18 @@
|
||||
@@ -334,6 +361,18 @@
|
||||
}
|
||||
|
||||
this.setRot(this.getYRot(), this.getXRot());
|
||||
@@ -114,7 +85,7 @@
|
||||
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));
|
||||
|
||||
@@ -368,8 +431,26 @@
|
||||
@@ -344,8 +383,26 @@
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
|
||||
@@ -141,7 +112,7 @@
|
||||
entity.push(this);
|
||||
}
|
||||
}
|
||||
@@ -381,6 +462,14 @@
|
||||
@@ -357,6 +414,14 @@
|
||||
Entity entity1 = (Entity) iterator1.next();
|
||||
|
||||
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
|
||||
@@ -156,7 +127,7 @@
|
||||
entity1.push(this);
|
||||
}
|
||||
}
|
||||
@@ -397,7 +486,7 @@
|
||||
@@ -373,7 +438,7 @@
|
||||
}
|
||||
|
||||
protected double getMaxSpeed() {
|
||||
@@ -165,7 +136,7 @@
|
||||
}
|
||||
|
||||
public void activateMinecart(int i, int j, int k, boolean flag) {}
|
||||
@@ -408,12 +497,16 @@
|
||||
@@ -384,12 +449,16 @@
|
||||
|
||||
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
|
||||
if (this.onGround()) {
|
||||
@@ -184,7 +155,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -609,7 +702,7 @@
|
||||
@@ -585,7 +654,7 @@
|
||||
}
|
||||
|
||||
protected void applyNaturalSlowdown() {
|
||||
@@ -193,7 +164,7 @@
|
||||
Vec3D vec3d = this.getDeltaMovement();
|
||||
|
||||
vec3d = vec3d.multiply(d0, 0.0D, d0);
|
||||
@@ -748,6 +841,14 @@
|
||||
@@ -724,6 +793,14 @@
|
||||
if (!this.level().isClientSide) {
|
||||
if (!entity.noPhysics && !this.noPhysics) {
|
||||
if (!this.hasPassenger(entity)) {
|
||||
@@ -208,7 +179,7 @@
|
||||
double d0 = entity.getX() - this.getX();
|
||||
double d1 = entity.getZ() - this.getZ();
|
||||
double d2 = d0 * d0 + d1 * d1;
|
||||
@@ -945,4 +1046,26 @@
|
||||
@@ -898,4 +975,26 @@
|
||||
|
||||
private EnumMinecartType() {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/VehicleEntity.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/VehicleEntity.java
|
||||
@@ -13,6 +13,12 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.entity.Vehicle;
|
||||
+import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
+import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class VehicleEntity extends Entity {
|
||||
|
||||
protected static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(VehicleEntity.class, DataWatcherRegistry.INT);
|
||||
@@ -29,6 +35,18 @@
|
||||
if (this.isInvulnerableTo(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
+ org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
+
|
||||
+ VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ f = (float) event.getDamage();
|
||||
+ // CraftBukkit end
|
||||
this.setHurtDir(-this.getHurtDir());
|
||||
this.setHurtTime(10);
|
||||
this.markHurt();
|
||||
@@ -38,9 +56,27 @@
|
||||
|
||||
if ((flag || this.getDamage() <= 40.0F) && !this.shouldSourceDestroy(damagesource)) {
|
||||
if (flag) {
|
||||
+ // CraftBukkit start
|
||||
+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(destroyEvent);
|
||||
+
|
||||
+ if (destroyEvent.isCancelled()) {
|
||||
+ this.setDamage(40.0F); // Maximize damage so this doesn't get triggered again right away
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.discard();
|
||||
}
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(destroyEvent);
|
||||
+
|
||||
+ if (destroyEvent.isCancelled()) {
|
||||
+ this.setDamage(40.0F); // Maximize damage so this doesn't get triggered again right away
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.destroy(damagesource);
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else {
|
||||
Slot slot2;
|
||||
@@ -605,13 +698,14 @@
|
||||
int j2;
|
||||
@@ -609,13 +702,14 @@
|
||||
ItemStack itemstack = this.getCarried();
|
||||
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -179,7 +179,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,6 +922,11 @@
|
||||
@@ -832,6 +926,11 @@
|
||||
}
|
||||
|
||||
public ItemStack getCarried() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/inventory/ContainerBrewingStand.java
|
||||
+++ b/net/minecraft/world/inventory/ContainerBrewingStand.java
|
||||
@@ -12,6 +12,11 @@
|
||||
@@ -13,6 +13,11 @@
|
||||
import net.minecraft.world.item.alchemy.PotionRegistry;
|
||||
import net.minecraft.world.item.alchemy.PotionUtil;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class ContainerBrewingStand extends Container {
|
||||
|
||||
private static final int BOTTLE_SLOT_START = 0;
|
||||
@@ -28,12 +33,18 @@
|
||||
@@ -29,12 +34,18 @@
|
||||
private final IContainerProperties brewingStandData;
|
||||
private final Slot ingredientSlot;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
checkContainerSize(iinventory, 5);
|
||||
checkContainerDataCount(icontainerproperties, 2);
|
||||
this.brewingStand = iinventory;
|
||||
@@ -61,6 +72,7 @@
|
||||
@@ -62,6 +73,7 @@
|
||||
|
||||
@Override
|
||||
public boolean stillValid(EntityHuman entityhuman) {
|
||||
@@ -39,7 +39,7 @@
|
||||
return this.brewingStand.stillValid(entityhuman);
|
||||
}
|
||||
|
||||
@@ -198,4 +210,17 @@
|
||||
@@ -199,4 +211,17 @@
|
||||
return 64;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class Containers<T extends Container> implements FeatureElement {
|
||||
|
||||
public static final Containers<ContainerChest> GENERIC_9x1 = register("generic_9x1", ContainerChest::oneRow);
|
||||
@@ -27,7 +31,7 @@
|
||||
@@ -28,7 +32,7 @@
|
||||
public static final Containers<ContainerGrindstone> GRINDSTONE = register("grindstone", ContainerGrindstone::new);
|
||||
public static final Containers<ContainerHopper> HOPPER = register("hopper", ContainerHopper::new);
|
||||
public static final Containers<ContainerLectern> LECTERN = register("lectern", (i, playerinventory) -> {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/world/inventory/CrafterMenu.java
|
||||
+++ b/net/minecraft/world/inventory/CrafterMenu.java
|
||||
@@ -8,8 +8,27 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.CrafterBlock;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafter;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class CrafterMenu extends Container implements ICrafting {
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ private CraftInventoryView bukkitEntity = null;
|
||||
+
|
||||
+ @Override
|
||||
+ public CraftInventoryView getBukkitView() {
|
||||
+ if (bukkitEntity != null) {
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
+
|
||||
+ CraftInventoryCrafter inventory = new CraftInventoryCrafter(this.container, this.resultContainer);
|
||||
+ bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this);
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
protected static final int SLOT_COUNT = 9;
|
||||
private static final int INV_SLOT_START = 9;
|
||||
private static final int INV_SLOT_END = 36;
|
||||
@@ -116,6 +135,7 @@
|
||||
|
||||
@Override
|
||||
public boolean stillValid(EntityHuman entityhuman) {
|
||||
+ if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.container.stillValid(entityhuman);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemBoat.java
|
||||
+++ b/net/minecraft/world/item/ItemBoat.java
|
||||
@@ -58,6 +58,13 @@
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
|
||||
if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
||||
@@ -11,10 +11,10 @@
|
||||
+ return InteractionResultWrapper.pass(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
EntityBoat entityboat = this.getBoat(world, movingobjectpositionblock);
|
||||
EntityBoat entityboat = this.getBoat(world, movingobjectpositionblock, itemstack, entityhuman);
|
||||
|
||||
entityboat.setVariant(this.type);
|
||||
@@ -66,7 +73,15 @@
|
||||
@@ -68,7 +75,15 @@
|
||||
return InteractionResultWrapper.fail(itemstack);
|
||||
} else {
|
||||
if (!world.isClientSide) {
|
||||
@@ -31,3 +31,12 @@
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.ENTITY_PLACE, movingobjectpositionblock.getLocation());
|
||||
if (!entityhuman.getAbilities().instabuild) {
|
||||
itemstack.shrink(1);
|
||||
@@ -86,7 +101,7 @@
|
||||
|
||||
private EntityBoat getBoat(World world, MovingObjectPosition movingobjectposition, ItemStack itemstack, EntityHuman entityhuman) {
|
||||
Vec3D vec3d = movingobjectposition.getLocation();
|
||||
- Object object = this.hasChest ? new ChestBoat(world, vec3d.x, vec3d.y, vec3d.z) : new EntityBoat(world, vec3d.x, vec3d.y, vec3d.z);
|
||||
+ EntityBoat object = this.hasChest ? new ChestBoat(world, vec3d.x, vec3d.y, vec3d.z) : new EntityBoat(world, vec3d.x, vec3d.y, vec3d.z); // CraftBukkit - decompile error
|
||||
|
||||
if (world instanceof WorldServer) {
|
||||
WorldServer worldserver = (WorldServer) world;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
||||
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
||||
@@ -39,7 +39,16 @@
|
||||
@@ -35,7 +35,16 @@
|
||||
|
||||
Vec3D vec3d = entityliving.position();
|
||||
|
||||
- if (entityliving.randomTeleport(d3, d4, d5, true)) {
|
||||
- if (entityliving.randomTeleport(d0, d1, d2, true)) {
|
||||
+ // CraftBukkit start - handle canceled status of teleport event
|
||||
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d3, d4, d5, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
|
||||
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d0, d1, d2, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
|
||||
+
|
||||
+ if (!status.isPresent()) {
|
||||
+ // teleport event was canceled, no more tries
|
||||
@@ -16,5 +16,5 @@
|
||||
+ if (status.get()) {
|
||||
+ // CraftBukkit end
|
||||
world.gameEvent(GameEvent.TELEPORT, vec3d, GameEvent.a.of((Entity) entityliving));
|
||||
SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.FOX_TELEPORT : SoundEffects.CHORUS_FRUIT_TELEPORT;
|
||||
|
||||
SoundEffect soundeffect;
|
||||
SoundCategory soundcategory;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemMinecart.java
|
||||
+++ b/net/minecraft/world/item/ItemMinecart.java
|
||||
@@ -18,6 +18,12 @@
|
||||
@@ -19,6 +19,12 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -13,17 +13,19 @@
|
||||
public class ItemMinecart extends Item {
|
||||
|
||||
private static final IDispenseBehavior DISPENSE_ITEM_BEHAVIOR = new DispenseBehaviorItem() {
|
||||
@@ -57,14 +63,43 @@
|
||||
@@ -58,10 +64,39 @@
|
||||
}
|
||||
}
|
||||
|
||||
- EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, d0, d1 + d3, d2, ((ItemMinecart) itemstack.getItem()).type);
|
||||
- EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, d0, d1 + d3, d2, ((ItemMinecart) itemstack.getItem()).type, itemstack, (EntityHuman) null);
|
||||
+ // CraftBukkit start
|
||||
+ // EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, d0, d1 + d3, d2, ((ItemMinecart) itemstack.getItem()).type);
|
||||
+ ItemStack itemstack1 = itemstack.split(1);
|
||||
+ org.bukkit.block.Block block2 = CraftBlock.at(worldserver, sourceblock.pos());
|
||||
+ CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
+
|
||||
|
||||
- worldserver.addFreshEntity(entityminecartabstract);
|
||||
- itemstack.shrink(1);
|
||||
+ BlockDispenseEvent event = new BlockDispenseEvent(block2, craftItem.clone(), new org.bukkit.util.Vector(d0, d1 + d3, d2));
|
||||
+ if (!BlockDispenser.eventFired) {
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
@@ -46,31 +48,25 @@
|
||||
+ }
|
||||
+
|
||||
+ itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
|
||||
+ EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((ItemMinecart) itemstack1.getItem()).type);
|
||||
|
||||
if (itemstack.hasCustomHoverName()) {
|
||||
entityminecartabstract.setCustomName(itemstack.getHoverName());
|
||||
}
|
||||
|
||||
- worldserver.addFreshEntity(entityminecartabstract);
|
||||
- itemstack.shrink(1);
|
||||
+ EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((ItemMinecart) itemstack1.getItem()).type, itemstack1, (EntityHuman) null);
|
||||
+
|
||||
+ if (!worldserver.addFreshEntity(entityminecartabstract)) itemstack.grow(1);
|
||||
+ // itemstack.shrink(1); // CraftBukkit - handled during event processing
|
||||
+ // CraftBukkit end
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -106,7 +141,12 @@
|
||||
entityminecartabstract.setCustomName(itemstack.getHoverName());
|
||||
}
|
||||
@@ -100,7 +135,12 @@
|
||||
|
||||
- world.addFreshEntity(entityminecartabstract);
|
||||
EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.0625D + d0, (double) blockposition.getZ() + 0.5D, this.type, itemstack, itemactioncontext.getPlayer());
|
||||
|
||||
- worldserver.addFreshEntity(entityminecartabstract);
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityminecartabstract).isCancelled()) {
|
||||
+ return EnumInteractionResult.FAIL;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ if (!world.addFreshEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit
|
||||
world.gameEvent(GameEvent.ENTITY_PLACE, blockposition, GameEvent.a.of(itemactioncontext.getPlayer(), world.getBlockState(blockposition.below())));
|
||||
+ if (!worldserver.addFreshEntity(entityminecartabstract)) return EnumInteractionResult.PASS; // CraftBukkit
|
||||
worldserver.gameEvent(GameEvent.ENTITY_PLACE, blockposition, GameEvent.a.of(itemactioncontext.getPlayer(), worldserver.getBlockState(blockposition.below())));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemMonsterEgg.java
|
||||
+++ b/net/minecraft/world/item/ItemMonsterEgg.java
|
||||
@@ -185,7 +185,7 @@
|
||||
@@ -180,7 +180,7 @@
|
||||
return Optional.empty();
|
||||
} else {
|
||||
((EntityInsentient) object).moveTo(vec3d.x(), vec3d.y(), vec3d.z(), 0.0F, 0.0F);
|
||||
@@ -9,7 +9,7 @@
|
||||
if (itemstack.hasCustomHoverName()) {
|
||||
((EntityInsentient) object).setCustomName(itemstack.getHoverName());
|
||||
}
|
||||
@@ -194,7 +194,7 @@
|
||||
@@ -189,7 +189,7 @@
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -77,6 +77,43 @@
|
||||
@@ -81,6 +81,43 @@
|
||||
import net.minecraft.world.level.block.state.pattern.ShapeDetectorBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
public final class ItemStack {
|
||||
|
||||
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
@@ -152,11 +189,24 @@
|
||||
@@ -175,7 +212,18 @@
|
||||
this.item = null;
|
||||
}
|
||||
|
||||
@@ -64,14 +64,7 @@
|
||||
this.item = (Item) BuiltInRegistries.ITEM.get(new MinecraftKey(nbttagcompound.getString("id")));
|
||||
this.count = nbttagcompound.getByte("Count");
|
||||
if (nbttagcompound.contains("tag", 10)) {
|
||||
- this.tag = nbttagcompound.getCompound("tag");
|
||||
+ // CraftBukkit start - make defensive copy as this data may be coming from the save thread
|
||||
+ this.tag = nbttagcompound.getCompound("tag").copy();
|
||||
+ // CraftBukkit end
|
||||
this.getItem().verifyTagAfterLoad(this.tag);
|
||||
}
|
||||
|
||||
@@ -166,6 +216,11 @@
|
||||
@@ -189,6 +237,11 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +76,7 @@
|
||||
public static ItemStack of(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
return new ItemStack(nbttagcompound);
|
||||
@@ -243,11 +298,190 @@
|
||||
@@ -266,11 +319,190 @@
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
Item item = this.getItem();
|
||||
@@ -212,7 +205,7 @@
|
||||
+ record.setCount(1);
|
||||
+ }
|
||||
+
|
||||
+ tileentityjukebox.setFirstItem(record);
|
||||
+ tileentityjukebox.setTheItem(record);
|
||||
+ world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entityhuman, world.getBlockState(blockposition)));
|
||||
+ }
|
||||
+
|
||||
@@ -276,7 +269,7 @@
|
||||
|
||||
return enuminteractionresult;
|
||||
}
|
||||
@@ -328,6 +562,21 @@
|
||||
@@ -351,6 +583,21 @@
|
||||
}
|
||||
|
||||
i -= k;
|
||||
@@ -298,7 +291,7 @@
|
||||
if (i <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -349,6 +598,11 @@
|
||||
@@ -372,6 +619,11 @@
|
||||
if (this.hurt(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||
consumer.accept(t0);
|
||||
Item item = this.getItem();
|
||||
@@ -310,7 +303,7 @@
|
||||
|
||||
this.shrink(1);
|
||||
if (t0 instanceof EntityHuman) {
|
||||
@@ -497,6 +751,17 @@
|
||||
@@ -524,6 +776,17 @@
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -328,7 +321,7 @@
|
||||
public NBTTagCompound getOrCreateTag() {
|
||||
if (this.tag == null) {
|
||||
this.setTag(new NBTTagCompound());
|
||||
@@ -921,6 +1186,13 @@
|
||||
@@ -948,6 +1211,13 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
+ itemstack.hurtAndBreak(1, entityhuman, (entityhuman1) -> {
|
||||
+ entityhuman1.broadcastBreakEvent(entityliving.getUsedItemHand());
|
||||
+ });
|
||||
+ entitythrowntrident.tridentItem = itemstack.copy(); // SPIGOT-4511 update since damage call moved
|
||||
+ entitythrowntrident.pickupItemStack = itemstack.copy(); // SPIGOT-4511 update since damage call moved
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
world.playSound((EntityHuman) null, (Entity) entitythrowntrident, SoundEffects.TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
--- a/net/minecraft/world/item/crafting/CraftingManager.java
|
||||
+++ b/net/minecraft/world/item/crafting/CraftingManager.java
|
||||
@@ -37,11 +37,13 @@
|
||||
@@ -34,11 +34,16 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class CraftingManager extends ResourceDataJson {
|
||||
|
||||
@@ -15,7 +18,7 @@
|
||||
private Map<MinecraftKey, RecipeHolder<?>> byName = ImmutableMap.of();
|
||||
private boolean hasErrors;
|
||||
|
||||
@@ -51,7 +53,12 @@
|
||||
@@ -48,7 +53,12 @@
|
||||
|
||||
protected void apply(Map<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
||||
this.hasErrors = false;
|
||||
@@ -29,7 +32,7 @@
|
||||
Builder<MinecraftKey, RecipeHolder<?>> builder = ImmutableMap.builder();
|
||||
Iterator iterator = map.entrySet().iterator();
|
||||
|
||||
@@ -62,8 +69,10 @@
|
||||
@@ -59,8 +69,10 @@
|
||||
try {
|
||||
RecipeHolder<?> recipeholder = fromJson(minecraftkey, ChatDeserializer.convertToJsonObject((JsonElement) entry.getValue(), "top element"));
|
||||
|
||||
@@ -42,7 +45,7 @@
|
||||
})).put(minecraftkey, recipeholder);
|
||||
builder.put(minecraftkey, recipeholder);
|
||||
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
||||
@@ -72,20 +81,37 @@
|
||||
@@ -69,20 +81,37 @@
|
||||
}
|
||||
|
||||
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
||||
@@ -83,7 +86,7 @@
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> Optional<Pair<MinecraftKey, RecipeHolder<T>>> getRecipeFor(Recipes<T> recipes, C c0, World world, @Nullable MinecraftKey minecraftkey) {
|
||||
@@ -119,7 +145,7 @@
|
||||
@@ -116,7 +145,7 @@
|
||||
}
|
||||
|
||||
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, RecipeHolder<T>> byType(Recipes<T> recipes) {
|
||||
@@ -92,7 +95,7 @@
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> NonNullList<ItemStack> getRemainingItemsFor(Recipes<T> recipes, C c0, World world) {
|
||||
@@ -166,12 +192,12 @@
|
||||
@@ -159,12 +188,12 @@
|
||||
|
||||
public void replaceRecipes(Iterable<RecipeHolder<?>> iterable) {
|
||||
this.hasErrors = false;
|
||||
@@ -107,14 +110,14 @@
|
||||
});
|
||||
MinecraftKey minecraftkey = recipeholder.id();
|
||||
RecipeHolder<?> recipeholder1 = (RecipeHolder) map1.put(minecraftkey, recipeholder);
|
||||
@@ -182,9 +208,29 @@
|
||||
@@ -175,9 +204,29 @@
|
||||
}
|
||||
});
|
||||
this.recipes = ImmutableMap.copyOf(map);
|
||||
- this.byName = builder.build();
|
||||
+ this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public boolean removeRecipe(MinecraftKey mcKey) {
|
||||
+ for (Object2ObjectLinkedOpenHashMap<MinecraftKey, RecipeHolder<?>> recipes : recipes.values()) {
|
||||
@@ -122,8 +125,8 @@
|
||||
+ }
|
||||
+
|
||||
+ return byName.remove(mcKey) != null;
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ public void clearRecipes() {
|
||||
+ this.recipes = Maps.newHashMap();
|
||||
+
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/crafting/IRecipe.java
|
||||
+++ b/net/minecraft/world/item/crafting/IRecipe.java
|
||||
@@ -63,4 +63,6 @@
|
||||
@@ -67,4 +67,6 @@
|
||||
return recipeitemstack.getItems().length == 0;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
+++ b/net/minecraft/world/item/crafting/RecipeItemStack.java
|
||||
@@ -38,6 +38,7 @@
|
||||
@@ -35,6 +35,7 @@
|
||||
public ItemStack[] itemStacks;
|
||||
@Nullable
|
||||
private IntList stackingIds;
|
||||
@@ -8,7 +8,7 @@
|
||||
public static final Codec<RecipeItemStack> CODEC = codec(true);
|
||||
public static final Codec<RecipeItemStack> CODEC_NONEMPTY = codec(false);
|
||||
|
||||
@@ -75,6 +76,15 @@
|
||||
@@ -72,6 +73,15 @@
|
||||
for (int j = 0; j < i; ++j) {
|
||||
ItemStack itemstack1 = aitemstack[j];
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/item/crafting/ShapedRecipes.java
|
||||
+++ b/net/minecraft/world/item/crafting/ShapedRecipes.java
|
||||
@@ -18,6 +18,14 @@
|
||||
@@ -10,6 +10,14 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.NamespacedKey;
|
||||
@@ -14,9 +14,9 @@
|
||||
+
|
||||
public class ShapedRecipes implements RecipeCrafting {
|
||||
|
||||
final int width;
|
||||
@@ -42,6 +50,68 @@
|
||||
this(s, craftingbookcategory, i, j, nonnulllist, itemstack, true);
|
||||
final ShapedRecipePattern pattern;
|
||||
@@ -30,6 +38,68 @@
|
||||
this(s, craftingbookcategory, shapedrecipepattern, itemstack, true);
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -27,9 +27,9 @@
|
||||
+ recipe.setGroup(this.group);
|
||||
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
||||
+
|
||||
+ switch (this.height) {
|
||||
+ switch (this.pattern.height()) {
|
||||
+ case 1:
|
||||
+ switch (this.width) {
|
||||
+ switch (this.pattern.width()) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a");
|
||||
+ break;
|
||||
@@ -42,7 +42,7 @@
|
||||
+ }
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ switch (this.width) {
|
||||
+ switch (this.pattern.width()) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a","b");
|
||||
+ break;
|
||||
@@ -55,7 +55,7 @@
|
||||
+ }
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ switch (this.width) {
|
||||
+ switch (this.pattern.width()) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a","b","c");
|
||||
+ break;
|
||||
@@ -69,7 +69,7 @@
|
||||
+ break;
|
||||
+ }
|
||||
+ char c = 'a';
|
||||
+ for (RecipeItemStack list : this.recipeItems) {
|
||||
+ for (RecipeItemStack list : this.pattern.ingredients()) {
|
||||
+ RecipeChoice choice = CraftRecipe.toBukkit(list);
|
||||
+ if (choice != null) {
|
||||
+ recipe.setIngredient(c, choice);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
--- a/net/minecraft/world/level/Explosion.java
|
||||
+++ b/net/minecraft/world/level/Explosion.java
|
||||
@@ -41,6 +41,15 @@
|
||||
@@ -39,6 +39,16 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.entity.boss.EntityComplexPart;
|
||||
+import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
+import org.bukkit.Location;
|
||||
@@ -16,15 +17,18 @@
|
||||
public class Explosion {
|
||||
|
||||
private static final ExplosionDamageCalculator EXPLOSION_DAMAGE_CALCULATOR = new ExplosionDamageCalculator();
|
||||
@@ -59,6 +68,7 @@
|
||||
private final ExplosionDamageCalculator damageCalculator;
|
||||
@@ -60,6 +70,10 @@
|
||||
private final SoundEffect explosionSound;
|
||||
private final ObjectArrayList<BlockPosition> toBlow;
|
||||
private final Map<EntityHuman, Vec3D> hitPlayers;
|
||||
+ public boolean wasCanceled = false; // CraftBukkit - add field
|
||||
+ // CraftBukkit - add field
|
||||
+ public boolean wasCanceled = false;
|
||||
+ public float yield;
|
||||
+ // CraftBukkit end
|
||||
|
||||
public Explosion(World world, @Nullable Entity entity, double d0, double d1, double d2, float f, List<BlockPosition> list) {
|
||||
this(world, entity, d0, d1, d2, f, false, Explosion.Effect.DESTROY_WITH_DECAY, list);
|
||||
@@ -79,7 +89,7 @@
|
||||
public static DamageSource getDefaultDamageSource(World world, @Nullable Entity entity) {
|
||||
return world.damageSources().explosion(entity, getIndirectSourceEntityInternal(entity));
|
||||
@@ -85,7 +99,7 @@
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
this.source = entity;
|
||||
@@ -33,7 +37,15 @@
|
||||
this.x = d0;
|
||||
this.y = d1;
|
||||
this.z = d2;
|
||||
@@ -129,6 +139,11 @@
|
||||
@@ -96,6 +110,7 @@
|
||||
this.smallExplosionParticles = particleparam;
|
||||
this.largeExplosionParticles = particleparam1;
|
||||
this.explosionSound = soundeffect;
|
||||
+ this.yield = this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
||||
}
|
||||
|
||||
private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) {
|
||||
@@ -146,6 +161,11 @@
|
||||
}
|
||||
|
||||
public void explode() {
|
||||
@@ -45,48 +57,46 @@
|
||||
this.level.gameEvent(this.source, GameEvent.EXPLODE, new Vec3D(this.x, this.y, this.z));
|
||||
Set<BlockPosition> set = Sets.newHashSet();
|
||||
boolean flag = true;
|
||||
@@ -213,7 +228,39 @@
|
||||
double d12 = (double) getSeenPercent(vec3d, entity);
|
||||
double d13 = (1.0D - d7) * d12;
|
||||
|
||||
- entity.hurt(this.getDamageSource(), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f2 + 1.0D)));
|
||||
+ // CraftBukkit start
|
||||
@@ -228,7 +248,37 @@
|
||||
d9 /= d11;
|
||||
d10 /= d11;
|
||||
if (this.damageCalculator.shouldDamageEntity(this, entity)) {
|
||||
- entity.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity));
|
||||
+ // CraftBukkit start
|
||||
+
|
||||
+ // Special case ender dragon only give knockback if no damage is cancelled
|
||||
+ // Thinks to note:
|
||||
+ // - Setting a velocity to a ComplexEntityPart is ignored (and therefore not needed)
|
||||
+ // - Damaging ComplexEntityPart while forward the damage to EntityEnderDragon
|
||||
+ // - Damaging EntityEnderDragon does nothing
|
||||
+ // - EntityEnderDragon hitbock always covers the other parts and is therefore always present
|
||||
+ if (entity instanceof EntityComplexPart) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ CraftEventFactory.entityDamage = source;
|
||||
+ entity.lastDamageCancelled = false;
|
||||
+
|
||||
+ if (entity instanceof EntityEnderDragon) {
|
||||
+ for (EntityComplexPart entityComplexPart : ((EntityEnderDragon) entity).subEntities) {
|
||||
+ // Calculate damage separately for each EntityComplexPart
|
||||
+ double d7part;
|
||||
+ if (list.contains(entityComplexPart) && (d7part = Math.sqrt(entityComplexPart.distanceToSqr(vec3d)) / f2) <= 1.0D) {
|
||||
+ double d13part = (1.0D - d7part) * getSeenPercent(vec3d, entityComplexPart);
|
||||
+ entityComplexPart.hurt(this.getDamageSource(), (float) ((int) ((d13part * d13part + d13part) / 2.0D * 7.0D * (double) f2 + 1.0D)));
|
||||
+ }
|
||||
+ // Special case ender dragon only give knockback if no damage is cancelled
|
||||
+ // Thinks to note:
|
||||
+ // - Setting a velocity to a ComplexEntityPart is ignored (and therefore not needed)
|
||||
+ // - Damaging ComplexEntityPart while forward the damage to EntityEnderDragon
|
||||
+ // - Damaging EntityEnderDragon does nothing
|
||||
+ // - EntityEnderDragon hitbock always covers the other parts and is therefore always present
|
||||
+ if (entity instanceof EntityComplexPart) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ } else {
|
||||
+ entity.hurt(this.getDamageSource(), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f2 + 1.0D)));
|
||||
+ }
|
||||
+
|
||||
+ CraftEventFactory.entityDamage = null;
|
||||
+ if (entity.lastDamageCancelled) { // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Skip entity if damage event was cancelled
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
double d14;
|
||||
+ CraftEventFactory.entityDamage = source;
|
||||
+ entity.lastDamageCancelled = false;
|
||||
+
|
||||
+ if (entity instanceof EntityEnderDragon) {
|
||||
+ for (EntityComplexPart entityComplexPart : ((EntityEnderDragon) entity).subEntities) {
|
||||
+ // Calculate damage separately for each EntityComplexPart
|
||||
+ if (list.contains(entityComplexPart)) {
|
||||
+ entityComplexPart.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity));
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ entity.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity));
|
||||
+ }
|
||||
+
|
||||
+ CraftEventFactory.entityDamage = null;
|
||||
+ if (entity.lastDamageCancelled) { // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Skip entity if damage event was cancelled
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
@@ -265,11 +312,66 @@
|
||||
double d12 = (1.0D - d7) * (double) getSeenPercent(vec3d, entity);
|
||||
@@ -287,9 +337,63 @@
|
||||
|
||||
SystemUtils.shuffle(this.toBlow, this.level.random);
|
||||
ObjectListIterator objectlistiterator = this.toBlow.iterator();
|
||||
@@ -104,22 +114,20 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ boolean cancelled;
|
||||
+ List<org.bukkit.block.Block> bukkitBlocks;
|
||||
+ float yield;
|
||||
+
|
||||
+ if (explode != null) {
|
||||
+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F);
|
||||
+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.yield);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ cancelled = event.isCancelled();
|
||||
+ this.wasCanceled = event.isCancelled();
|
||||
+ bukkitBlocks = event.blockList();
|
||||
+ yield = event.getYield();
|
||||
+ this.yield = event.getYield();
|
||||
+ } else {
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F);
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ cancelled = event.isCancelled();
|
||||
+ this.wasCanceled = event.isCancelled();
|
||||
+ bukkitBlocks = event.blockList();
|
||||
+ yield = event.getYield();
|
||||
+ this.yield = event.getYield();
|
||||
+ }
|
||||
+
|
||||
+ this.toBlow.clear();
|
||||
@@ -129,8 +137,7 @@
|
||||
+ toBlow.add(coords);
|
||||
+ }
|
||||
+
|
||||
+ if (cancelled) {
|
||||
+ this.wasCanceled = true;
|
||||
+ if (this.wasCanceled) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
@@ -138,9 +145,9 @@
|
||||
|
||||
while (objectlistiterator.hasNext()) {
|
||||
BlockPosition blockposition = (BlockPosition) objectlistiterator.next();
|
||||
IBlockData iblockdata = this.level.getBlockState(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
+ // CraftBukkit start - TNTPrimeEvent
|
||||
+ IBlockData iblockdata = this.level.getBlockState(blockposition);
|
||||
+ Block block = iblockdata.getBlock();
|
||||
+ if (block instanceof net.minecraft.world.level.block.BlockTNT) {
|
||||
+ Entity sourceEntity = source == null ? null : source;
|
||||
+ BlockPosition sourceBlock = sourceEntity == null ? BlockPosition.containing(this.x, this.y, this.z) : null;
|
||||
@@ -151,37 +158,26 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (!iblockdata.isAir()) {
|
||||
BlockPosition blockposition1 = blockposition.immutable();
|
||||
@@ -283,8 +385,8 @@
|
||||
TileEntity tileentity = iblockdata.hasBlockEntity() ? this.level.getBlockEntity(blockposition) : null;
|
||||
LootParams.a lootparams_a = (new LootParams.a(worldserver)).withParameter(LootContextParameters.ORIGIN, Vec3D.atCenterOf(blockposition)).withParameter(LootContextParameters.TOOL, ItemStack.EMPTY).withOptionalParameter(LootContextParameters.BLOCK_ENTITY, tileentity).withOptionalParameter(LootContextParameters.THIS_ENTITY, this.source);
|
||||
this.level.getBlockState(blockposition).onExplosionHit(this.level, blockposition, this, (itemstack, blockposition1) -> {
|
||||
addOrAppendStack(list, itemstack, blockposition1);
|
||||
@@ -314,7 +418,11 @@
|
||||
BlockPosition blockposition1 = (BlockPosition) objectlistiterator1.next();
|
||||
|
||||
- if (this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY) {
|
||||
- lootparams_a.withParameter(LootContextParameters.EXPLOSION_RADIUS, this.radius);
|
||||
+ if (yield < 1.0F) { // CraftBukkit - add yield
|
||||
+ lootparams_a.withParameter(LootContextParameters.EXPLOSION_RADIUS, 1.0F / yield); // CraftBukkit - add yield
|
||||
}
|
||||
|
||||
iblockdata.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, flag2);
|
||||
@@ -316,7 +418,11 @@
|
||||
BlockPosition blockposition2 = (BlockPosition) objectlistiterator1.next();
|
||||
|
||||
if (this.random.nextInt(3) == 0 && this.level.getBlockState(blockposition2).isAir() && this.level.getBlockState(blockposition2.below()).isSolidRender(this.level, blockposition2.below())) {
|
||||
- this.level.setBlockAndUpdate(blockposition2, BlockFireAbstract.getState(this.level, blockposition2));
|
||||
if (this.random.nextInt(3) == 0 && this.level.getBlockState(blockposition1).isAir() && this.level.getBlockState(blockposition1.below()).isSolidRender(this.level, blockposition1.below())) {
|
||||
- this.level.setBlockAndUpdate(blockposition1, BlockFireAbstract.getState(this.level, blockposition1));
|
||||
+ // CraftBukkit start - Ignition by explosion
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(this.level, blockposition2.getX(), blockposition2.getY(), blockposition2.getZ(), this).isCancelled()) {
|
||||
+ this.level.setBlockAndUpdate(blockposition2, BlockFireAbstract.getState(this.level, blockposition2));
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(this.level, blockposition1, this).isCancelled()) {
|
||||
+ this.level.setBlockAndUpdate(blockposition1, BlockFireAbstract.getState(this.level, blockposition1));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,6 +434,7 @@
|
||||
@@ -322,6 +430,7 @@
|
||||
}
|
||||
|
||||
private static void addBlockDrops(ObjectArrayList<Pair<ItemStack, BlockPosition>> objectarraylist, ItemStack itemstack, BlockPosition blockposition) {
|
||||
private static void addOrAppendStack(List<Pair<ItemStack, BlockPosition>> list, ItemStack itemstack, BlockPosition blockposition) {
|
||||
+ if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-5425
|
||||
int i = objectarraylist.size();
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
Pair<ItemStack, BlockPosition> pair = (Pair) list.get(i);
|
||||
ItemStack itemstack1 = (ItemStack) pair.getFirst();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/GameRules.java
|
||||
+++ b/net/minecraft/world/level/GameRules.java
|
||||
@@ -138,7 +138,7 @@
|
||||
@@ -142,7 +142,7 @@
|
||||
}
|
||||
|
||||
public <T extends GameRules.GameRuleValue<T>> T getRule(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound createTag() {
|
||||
@@ -152,7 +152,7 @@
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
private void loadFromTag(DynamicLike<?> dynamiclike) {
|
||||
this.rules.forEach((gamerules_gamerulekey, gamerules_gamerulevalue) -> {
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
Objects.requireNonNull(gamerules_gamerulevalue);
|
||||
optional.ifPresent(gamerules_gamerulevalue::deserialize);
|
||||
@@ -172,8 +172,8 @@
|
||||
@@ -176,8 +176,8 @@
|
||||
}
|
||||
|
||||
private static <T extends GameRules.GameRuleValue<T>> void callVisitorCap(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<?> gamerules_gamerulekey, GameRules.GameRuleDefinition<?> gamerules_gameruledefinition) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
public void assignFrom(GameRules gamerules, @Nullable MinecraftServer minecraftserver) {
|
||||
@@ -265,7 +265,7 @@
|
||||
@@ -269,7 +269,7 @@
|
||||
}
|
||||
|
||||
public T createRule() {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
public void callVisitor(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
||||
@@ -295,7 +295,7 @@
|
||||
@@ -299,7 +299,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
public abstract String serialize();
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
@@ -365,7 +365,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +56,7 @@
|
||||
this.value = Boolean.parseBoolean(s);
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
@@ -430,7 +430,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/MobSpawnerAbstract.java
|
||||
+++ b/net/minecraft/world/level/MobSpawnerAbstract.java
|
||||
@@ -50,6 +50,7 @@
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
public void setEntityId(EntityTypes<?> entitytypes, @Nullable World world, RandomSource randomsource, BlockPosition blockposition) {
|
||||
this.getOrCreateNextSpawnData(world, randomsource, blockposition).getEntityToSpawn().putString("id", BuiltInRegistries.ENTITY_TYPE.getKey(entitytypes).toString());
|
||||
@@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
private boolean isNearPlayer(World world, BlockPosition blockposition) {
|
||||
@@ -152,7 +153,12 @@
|
||||
@@ -154,7 +155,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/RayTrace.java
|
||||
+++ b/net/minecraft/world/level/RayTrace.java
|
||||
@@ -26,7 +26,7 @@
|
||||
this.to = vec3d1;
|
||||
this.block = raytrace_blockcollisionoption;
|
||||
this.fluid = raytrace_fluidcollisionoption;
|
||||
- this.collisionContext = VoxelShapeCollision.of(entity);
|
||||
+ this.collisionContext = (entity == null) ? VoxelShapeCollision.empty() : VoxelShapeCollision.of(entity); // CraftBukkit
|
||||
@@ -22,7 +22,7 @@
|
||||
private final VoxelShapeCollision collisionContext;
|
||||
|
||||
public RayTrace(Vec3D vec3d, Vec3D vec3d1, RayTrace.BlockCollisionOption raytrace_blockcollisionoption, RayTrace.FluidCollisionOption raytrace_fluidcollisionoption, Entity entity) {
|
||||
- this(vec3d, vec3d1, raytrace_blockcollisionoption, raytrace_fluidcollisionoption, VoxelShapeCollision.of(entity));
|
||||
+ this(vec3d, vec3d1, raytrace_blockcollisionoption, raytrace_fluidcollisionoption, (entity == null) ? VoxelShapeCollision.empty() : VoxelShapeCollision.of(entity)); // CraftBukkit
|
||||
}
|
||||
|
||||
public Vec3D getTo() {
|
||||
@@ -75,7 +75,7 @@
|
||||
public RayTrace(Vec3D vec3d, Vec3D vec3d1, RayTrace.BlockCollisionOption raytrace_blockcollisionoption, RayTrace.FluidCollisionOption raytrace_fluidcollisionoption, VoxelShapeCollision voxelshapecollision) {
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
private final Predicate<Fluid> canPick;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/World.java
|
||||
+++ b/net/minecraft/world/level/World.java
|
||||
@@ -72,6 +72,31 @@
|
||||
@@ -75,6 +75,31 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import net.minecraft.world.scores.Scoreboard;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
public static final Codec<ResourceKey<World>> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION);
|
||||
@@ -114,7 +139,43 @@
|
||||
@@ -117,7 +142,43 @@
|
||||
private final DamageSources damageSources;
|
||||
private long subTickCount;
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
this.profiler = supplier;
|
||||
this.levelData = worlddatamutable;
|
||||
this.dimensionTypeRegistration = holder;
|
||||
@@ -129,12 +190,12 @@
|
||||
@@ -132,12 +193,12 @@
|
||||
this.worldBorder = new WorldBorder() {
|
||||
@Override
|
||||
public double getCenterX() {
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@@ -147,6 +208,42 @@
|
||||
@@ -150,6 +211,42 @@
|
||||
this.neighborUpdater = new CollectingNeighborUpdater(this, j);
|
||||
this.registryAccess = iregistrycustom;
|
||||
this.damageSources = new DamageSources(iregistrycustom);
|
||||
@@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -204,6 +301,17 @@
|
||||
@@ -207,6 +304,17 @@
|
||||
|
||||
@Override
|
||||
public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
|
||||
@@ -153,7 +153,7 @@
|
||||
if (this.isOutsideBuildHeight(blockposition)) {
|
||||
return false;
|
||||
} else if (!this.isClientSide && this.isDebug()) {
|
||||
@@ -211,13 +319,29 @@
|
||||
@@ -214,13 +322,29 @@
|
||||
} else {
|
||||
Chunk chunk = this.getChunkAt(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
@@ -184,7 +184,7 @@
|
||||
if (iblockdata2 == iblockdata) {
|
||||
if (iblockdata1 != iblockdata2) {
|
||||
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
||||
@@ -244,12 +368,69 @@
|
||||
@@ -247,12 +371,69 @@
|
||||
|
||||
this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
|
||||
}
|
||||
@@ -254,7 +254,7 @@
|
||||
public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||
|
||||
@Override
|
||||
@@ -335,6 +516,14 @@
|
||||
@@ -338,6 +519,14 @@
|
||||
|
||||
@Override
|
||||
public IBlockData getBlockState(BlockPosition blockposition) {
|
||||
@@ -269,7 +269,7 @@
|
||||
if (this.isOutsideBuildHeight(blockposition)) {
|
||||
return Blocks.VOID_AIR.defaultBlockState();
|
||||
} else {
|
||||
@@ -526,6 +715,16 @@
|
||||
@@ -543,6 +732,16 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity getBlockEntity(BlockPosition blockposition) {
|
||||
@@ -286,7 +286,7 @@
|
||||
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
|
||||
}
|
||||
|
||||
@@ -533,6 +732,12 @@
|
||||
@@ -550,6 +749,12 @@
|
||||
BlockPosition blockposition = tileentity.getBlockPos();
|
||||
|
||||
if (!this.isOutsideBuildHeight(blockposition)) {
|
||||
@@ -299,7 +299,7 @@
|
||||
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
|
||||
}
|
||||
}
|
||||
@@ -663,7 +868,7 @@
|
||||
@@ -680,7 +885,7 @@
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EntityComplexPart entitycomplexpart = aentitycomplexpart[k];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
+++ b/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -45,6 +45,11 @@
|
||||
@Override
|
||||
public void onProjectileHit(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && this.canBeLit(iblockdata)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
+++ b/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
@@ -41,6 +41,11 @@
|
||||
@@ -42,6 +42,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
+
|
||||
public class BigDripleafBlock extends BlockFacingHorizontal implements IBlockFragilePlantElement, IBlockWaterlogged {
|
||||
|
||||
private static final BlockStateBoolean WATERLOGGED = BlockProperties.WATERLOGGED;
|
||||
@@ -109,7 +114,7 @@
|
||||
public static final MapCodec<BigDripleafBlock> CODEC = simpleCodec(BigDripleafBlock::new);
|
||||
@@ -116,7 +121,7 @@
|
||||
|
||||
@Override
|
||||
public void onProjectileHit(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,7 +173,20 @@
|
||||
@@ -175,7 +180,20 @@
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!world.isClientSide) {
|
||||
if (iblockdata.getValue(BigDripleafBlock.TILT) == Tilt.NONE && canEntityTilt(blockposition, entity) && !world.hasNeighborSignal(blockposition)) {
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -182,9 +200,9 @@
|
||||
@@ -189,9 +207,9 @@
|
||||
Tilt tilt = (Tilt) iblockdata.getValue(BigDripleafBlock.TILT);
|
||||
|
||||
if (tilt == Tilt.UNSTABLE) {
|
||||
@@ -55,7 +55,7 @@
|
||||
} else if (tilt == Tilt.FULL) {
|
||||
resetTilt(iblockdata, worldserver, blockposition);
|
||||
}
|
||||
@@ -210,8 +228,10 @@
|
||||
@@ -217,8 +235,10 @@
|
||||
return entity.onGround() && entity.position().y > (double) ((float) blockposition.getY() + 0.6875F);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
if (soundeffect != null) {
|
||||
playTiltSound(world, blockposition, soundeffect);
|
||||
}
|
||||
@@ -225,14 +245,21 @@
|
||||
@@ -232,14 +252,21 @@
|
||||
}
|
||||
|
||||
private static void resetTilt(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -92,7 +92,7 @@
|
||||
Tilt tilt1 = (Tilt) iblockdata.getValue(BigDripleafBlock.TILT);
|
||||
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BigDripleafBlock.TILT, tilt), 2);
|
||||
@@ -240,6 +267,7 @@
|
||||
@@ -247,6 +274,7 @@
|
||||
world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, blockposition);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/Block.java
|
||||
+++ b/net/minecraft/world/level/block/Block.java
|
||||
@@ -342,7 +342,13 @@
|
||||
@@ -349,7 +349,13 @@
|
||||
EntityItem entityitem = (EntityItem) supplier.get();
|
||||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,7 +374,7 @@
|
||||
@@ -375,7 +381,7 @@
|
||||
|
||||
public void playerDestroy(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
|
||||
entityhuman.awardStat(StatisticList.BLOCK_MINED.get(this));
|
||||
@@ -24,7 +24,7 @@
|
||||
dropResources(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
|
||||
}
|
||||
|
||||
@@ -504,17 +510,25 @@
|
||||
@@ -512,17 +518,25 @@
|
||||
return this.builtInRegistryHolder;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBamboo.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBamboo.java
|
||||
@@ -180,7 +180,7 @@
|
||||
@@ -187,7 +187,7 @@
|
||||
BlockPosition blockposition1 = blockposition.above(i);
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -201,14 +201,18 @@
|
||||
@@ -208,14 +208,18 @@
|
||||
BlockPosition blockposition1 = blockposition.below(2);
|
||||
IBlockData iblockdata2 = world.getBlockState(blockposition1);
|
||||
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -219,7 +223,14 @@
|
||||
@@ -226,7 +230,14 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockBamboo.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
|
||||
int k = (i < 11 || randomsource.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
@@ -88,6 +88,6 @@
|
||||
@@ -95,6 +95,6 @@
|
||||
}
|
||||
|
||||
protected void growBamboo(World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBed.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBed.java
|
||||
@@ -84,7 +84,8 @@
|
||||
@@ -94,7 +94,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
world.removeBlock(blockposition, false);
|
||||
BlockPosition blockposition1 = blockposition.relative(((EnumDirection) iblockdata.getValue(BlockBed.FACING)).getOpposite());
|
||||
|
||||
@@ -103,7 +104,16 @@
|
||||
@@ -113,7 +114,16 @@
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
@@ -27,7 +27,7 @@
|
||||
if (entityhuman_enumbedresult.getMessage() != null) {
|
||||
entityhuman.displayClientMessage(entityhuman_enumbedresult.getMessage(), true);
|
||||
}
|
||||
@@ -114,8 +124,29 @@
|
||||
@@ -124,8 +134,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
private boolean kickVillagerOutOfBed(World world, BlockPosition blockposition) {
|
||||
@@ -314,6 +345,11 @@
|
||||
@@ -324,6 +355,11 @@
|
||||
BlockPosition blockposition1 = blockposition.relative((EnumDirection) iblockdata.getValue(BlockBed.FACING));
|
||||
|
||||
world.setBlock(blockposition1, (IBlockData) iblockdata.setValue(BlockBed.PART, BlockPropertyBedPart.HEAD), 3);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBeehive.java
|
||||
@@ -112,7 +112,7 @@
|
||||
@@ -119,7 +119,7 @@
|
||||
if (entitybee.getTarget() == null) {
|
||||
EntityHuman entityhuman = (EntityHuman) SystemUtils.getRandom(list1, world.random);
|
||||
|
||||
@@ -9,20 +9,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,4 +338,16 @@
|
||||
|
||||
return super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - fix MC-227255
|
||||
+ @Override
|
||||
+ public IBlockData rotate(IBlockData iblockdata, EnumBlockRotation enumblockrotation) {
|
||||
+ return iblockdata.setValue(BlockBeehive.FACING, enumblockrotation.rotate(iblockdata.getValue(BlockBeehive.FACING)));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockData mirror(IBlockData iblockdata, EnumBlockMirror enumblockmirror) {
|
||||
+ return iblockdata.rotate(enumblockmirror.getRotation(iblockdata.getValue(BlockBeehive.FACING)));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBell.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBell.java
|
||||
@@ -136,6 +136,11 @@
|
||||
@@ -146,6 +146,11 @@
|
||||
if (enumdirection == null) {
|
||||
enumdirection = (EnumDirection) world.getBlockState(blockposition).getValue(BlockBell.FACING);
|
||||
}
|
||||
@@ -12,20 +12,3 @@
|
||||
|
||||
((TileEntityBell) tileentity).onHit(enumdirection);
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.BELL_BLOCK, SoundCategory.BLOCKS, 2.0F, 1.0F);
|
||||
@@ -262,4 +267,16 @@
|
||||
public boolean isPathfindable(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - fix MC-253819
|
||||
+ @Override
|
||||
+ public IBlockData rotate(IBlockData iblockdata, EnumBlockRotation enumblockrotation) {
|
||||
+ return iblockdata.setValue(BlockBell.FACING, enumblockrotation.rotate(iblockdata.getValue(BlockBell.FACING)));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockData mirror(IBlockData iblockdata, EnumBlockMirror enumblockmirror) {
|
||||
+ return iblockdata.rotate(enumblockmirror.getRotation(iblockdata.getValue(BlockBell.FACING)));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockButtonAbstract.java
|
||||
+++ b/net/minecraft/world/level/block/BlockButtonAbstract.java
|
||||
@@ -27,6 +27,11 @@
|
||||
@@ -33,6 +33,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
+
|
||||
public class BlockButtonAbstract extends BlockAttachable {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -108,6 +113,19 @@
|
||||
public static final MapCodec<BlockButtonAbstract> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -124,6 +129,19 @@
|
||||
if ((Boolean) iblockdata.getValue(BlockButtonAbstract.POWERED)) {
|
||||
return EnumInteractionResult.CONSUME;
|
||||
} else {
|
||||
@@ -32,12 +32,12 @@
|
||||
this.press(iblockdata, world, blockposition);
|
||||
this.playSound(entityhuman, world, blockposition, true);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.BLOCK_ACTIVATE, blockposition);
|
||||
@@ -170,11 +188,36 @@
|
||||
@@ -195,11 +213,36 @@
|
||||
}
|
||||
|
||||
protected void checkPressed(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
- EntityArrow entityarrow = this.arrowsCanPress ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse((Object) null) : null;
|
||||
+ EntityArrow entityarrow = this.arrowsCanPress ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse(null) : null; // CraftBukkit - decompile error
|
||||
- EntityArrow entityarrow = this.type.canButtonBeActivatedByArrows() ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse((Object) null) : null;
|
||||
+ EntityArrow entityarrow = this.type.canButtonBeActivatedByArrows() ? (EntityArrow) world.getEntitiesOfClass(EntityArrow.class, iblockdata.getShape(world, blockposition).bounds().move(blockposition)).stream().findFirst().orElse(null) : null; // CraftBukkit - decompile error
|
||||
boolean flag = entityarrow != null;
|
||||
boolean flag1 = (Boolean) iblockdata.getValue(BlockButtonAbstract.POWERED);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCactus.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCactus.java
|
||||
@@ -21,6 +21,8 @@
|
||||
@@ -22,6 +22,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockCactus extends Block {
|
||||
|
||||
public static final BlockStateInteger AGE = BlockProperties.AGE_15;
|
||||
@@ -57,7 +59,7 @@
|
||||
public static final MapCodec<BlockCactus> CODEC = simpleCodec(BlockCactus::new);
|
||||
@@ -64,7 +66,7 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockCactus.AGE);
|
||||
|
||||
if (j == 15) {
|
||||
@@ -18,7 +18,7 @@
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockCactus.AGE, 0);
|
||||
|
||||
worldserver.setBlock(blockposition, iblockdata1, 4);
|
||||
@@ -112,7 +114,9 @@
|
||||
@@ -119,7 +121,9 @@
|
||||
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCake.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCake.java
|
||||
@@ -85,7 +85,18 @@
|
||||
@@ -92,7 +92,18 @@
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
entityhuman.awardStat(StatisticList.EAT_CAKE_SLICE);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
||||
@@ -47,6 +47,10 @@
|
||||
@@ -50,6 +50,10 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
+
|
||||
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
@@ -91,7 +95,9 @@
|
||||
public static final MapCodec<BlockCampfire> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -106,7 +110,9 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
super.entityInside(iblockdata, world, blockposition, entity);
|
||||
@@ -201,6 +207,11 @@
|
||||
@@ -216,6 +222,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCauldron.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCauldron.java
|
||||
@@ -11,6 +11,10 @@
|
||||
@@ -12,6 +12,10 @@
|
||||
import net.minecraft.world.level.material.FluidType;
|
||||
import net.minecraft.world.level.material.FluidTypes;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
+
|
||||
public class BlockCauldron extends AbstractCauldronBlock {
|
||||
|
||||
private static final float RAIN_FILL_CHANCE = 0.05F;
|
||||
@@ -54,13 +58,11 @@
|
||||
public static final MapCodec<BlockCauldron> CODEC = simpleCodec(BlockCauldron::new);
|
||||
@@ -61,13 +65,11 @@
|
||||
|
||||
if (fluidtype == FluidTypes.WATER) {
|
||||
iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockChest.java
|
||||
+++ b/net/minecraft/world/level/block/BlockChest.java
|
||||
@@ -87,24 +87,7 @@
|
||||
@@ -93,24 +93,7 @@
|
||||
public Optional<ITileInventory> acceptDouble(final TileEntityChest tileentitychest, final TileEntityChest tileentitychest1) {
|
||||
final InventoryLargeChest inventorylargechest = new InventoryLargeChest(tileentitychest, tileentitychest1);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
public Optional<ITileInventory> acceptSingle(TileEntityChest tileentitychest) {
|
||||
@@ -117,6 +100,38 @@
|
||||
@@ -123,6 +106,38 @@
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
+ };
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
protected BlockChest(BlockBase.Info blockbase_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) {
|
||||
super(blockbase_info, supplier);
|
||||
this.registerDefaultState((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(BlockChest.FACING, EnumDirection.NORTH)).setValue(BlockChest.TYPE, BlockPropertyChestType.SINGLE)).setValue(BlockChest.WATERLOGGED, false));
|
||||
@@ -275,7 +290,7 @@
|
||||
@Override
|
||||
public MapCodec<? extends BlockChest> codec() {
|
||||
return BlockChest.CODEC;
|
||||
@@ -278,7 +293,7 @@
|
||||
|
||||
@Override
|
||||
public DoubleBlockFinder.Result<? extends TileEntityChest> combine(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
if (flag) {
|
||||
bipredicate = (generatoraccess, blockposition1) -> {
|
||||
@@ -291,7 +306,14 @@
|
||||
@@ -294,7 +309,14 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public ITileInventory getMenuProvider(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
+++ b/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
@@ -20,6 +20,8 @@
|
||||
@@ -22,6 +22,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
@@ -8,23 +8,23 @@
|
||||
+
|
||||
public class BlockChorusFlower extends Block {
|
||||
|
||||
public static final int DEAD_AGE = 5;
|
||||
@@ -90,8 +92,12 @@
|
||||
public static final MapCodec<BlockChorusFlower> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -102,8 +104,12 @@
|
||||
}
|
||||
|
||||
if (flag && allNeighborsEmpty(worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmptyBlock(blockposition.above(2))) {
|
||||
- worldserver.setBlock(blockposition, this.plant.getStateForPlacement(worldserver, blockposition), 2);
|
||||
- worldserver.setBlock(blockposition, BlockChorusFruit.getStateWithConnections(worldserver, blockposition, this.plant.defaultBlockState()), 2);
|
||||
- this.placeGrownFlower(worldserver, blockposition1, i);
|
||||
+ // CraftBukkit start - add event
|
||||
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.defaultBlockState().setValue(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) {
|
||||
+ worldserver.setBlock(blockposition, this.plant.getStateForPlacement(worldserver, blockposition), 2);
|
||||
+ worldserver.setBlock(blockposition, BlockChorusFruit.getStateWithConnections(worldserver, blockposition, this.plant.defaultBlockState()), 2);
|
||||
+ this.placeGrownFlower(worldserver, blockposition1, i);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (i < 4) {
|
||||
j = randomsource.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -105,18 +111,30 @@
|
||||
@@ -117,18 +123,30 @@
|
||||
BlockPosition blockposition2 = blockposition.relative(enumdirection);
|
||||
|
||||
if (worldserver.isEmptyBlock(blockposition2) && worldserver.isEmptyBlock(blockposition2.below()) && allNeighborsEmpty(worldserver, blockposition2, enumdirection.getOpposite())) {
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
worldserver.setBlock(blockposition, this.plant.getStateForPlacement(worldserver, blockposition), 2);
|
||||
worldserver.setBlock(blockposition, BlockChorusFruit.getStateWithConnections(worldserver, blockposition, this.plant.defaultBlockState()), 2);
|
||||
} else {
|
||||
- this.placeDeadFlower(worldserver, blockposition);
|
||||
+ // CraftBukkit start - add event
|
||||
@@ -59,10 +59,10 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -253,6 +271,11 @@
|
||||
@@ -265,6 +283,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.getType().is(TagsEntity.IMPACT_PROJECTILES)) {
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.mayBreak(world)) {
|
||||
+ // CraftBukkit
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.defaultBlockState())) {
|
||||
+ return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCocoa.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCocoa.java
|
||||
@@ -20,6 +20,8 @@
|
||||
@@ -21,6 +21,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
|
||||
|
||||
public static final int MAX_AGE = 2;
|
||||
@@ -54,7 +56,7 @@
|
||||
public static final MapCodec<BlockCocoa> CODEC = simpleCodec(BlockCocoa::new);
|
||||
@@ -61,7 +63,7 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockCocoa.AGE);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +126,7 @@
|
||||
@@ -131,7 +133,7 @@
|
||||
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCommand.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCommand.java
|
||||
@@ -27,6 +27,8 @@
|
||||
@@ -30,6 +30,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockCommand extends BlockTileEntity implements GameMasterBlock {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -57,6 +59,15 @@
|
||||
public static final MapCodec<BlockCommand> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -70,6 +72,15 @@
|
||||
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
boolean flag2 = tileentitycommand.isPowered();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockComposter.java
|
||||
+++ b/net/minecraft/world/level/block/BlockComposter.java
|
||||
@@ -40,6 +40,11 @@
|
||||
@@ -41,6 +41,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
+
|
||||
public class BlockComposter extends Block implements IInventoryHolder {
|
||||
|
||||
public static final int READY = 8;
|
||||
@@ -248,7 +253,14 @@
|
||||
public static final MapCodec<BlockComposter> CODEC = simpleCodec(BlockComposter::new);
|
||||
@@ -255,7 +260,14 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockComposter.LEVEL);
|
||||
|
||||
if (i < 7 && BlockComposter.COMPOSTABLES.containsKey(itemstack.getItem())) {
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
itemstack.shrink(1);
|
||||
return iblockdata1;
|
||||
@@ -258,6 +270,14 @@
|
||||
@@ -265,6 +277,14 @@
|
||||
}
|
||||
|
||||
public static IBlockData extractProduce(Entity entity, IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -43,7 +43,7 @@
|
||||
if (!world.isClientSide) {
|
||||
Vec3D vec3d = Vec3D.atLowerCornerWithOffset(blockposition, 0.5D, 1.01D, 0.5D).offsetRandom(world.random, 0.7F);
|
||||
EntityItem entityitem = new EntityItem(world, vec3d.x(), vec3d.y(), vec3d.z(), new ItemStack(Items.BONE_MEAL));
|
||||
@@ -281,10 +301,16 @@
|
||||
@@ -288,10 +308,16 @@
|
||||
}
|
||||
|
||||
static IBlockData addItem(@Nullable Entity entity, IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) {
|
||||
@@ -61,7 +61,7 @@
|
||||
return iblockdata;
|
||||
} else {
|
||||
int j = i + 1;
|
||||
@@ -333,7 +359,8 @@
|
||||
@@ -340,7 +366,8 @@
|
||||
public IWorldInventory getContainer(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
int i = (Integer) iblockdata.getValue(BlockComposter.LEVEL);
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
|
||||
public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||
@@ -348,6 +375,7 @@
|
||||
@@ -355,6 +382,7 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
this.pos = blockposition;
|
||||
@@ -79,7 +79,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -372,8 +400,15 @@
|
||||
@@ -379,8 +407,15 @@
|
||||
|
||||
@Override
|
||||
public void setChanged() {
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,6 +421,7 @@
|
||||
@@ -393,6 +428,7 @@
|
||||
|
||||
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
super(1);
|
||||
@@ -103,7 +103,7 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
this.pos = blockposition;
|
||||
@@ -428,8 +464,9 @@
|
||||
@@ -435,8 +471,9 @@
|
||||
|
||||
public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
+++ b/net/minecraft/world/level/block/BlockConcretePowder.java
|
||||
@@ -11,6 +11,12 @@
|
||||
@@ -14,6 +14,12 @@
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -12,21 +12,21 @@
|
||||
+
|
||||
public class BlockConcretePowder extends BlockFalling {
|
||||
|
||||
private final IBlockData concrete;
|
||||
@@ -23,7 +29,7 @@
|
||||
public static final MapCodec<BlockConcretePowder> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -36,7 +42,7 @@
|
||||
@Override
|
||||
public void onLand(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
|
||||
if (shouldSolidify(world, blockposition, iblockdata1)) {
|
||||
- world.setBlock(blockposition, this.concrete, 3);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.concrete, 3); // CraftBukkit
|
||||
- world.setBlock(blockposition, this.concrete.defaultBlockState(), 3);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.concrete.defaultBlockState(), 3); // CraftBukkit
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +40,24 @@
|
||||
@@ -47,7 +53,24 @@
|
||||
BlockPosition blockposition = blockactioncontext.getClickedPos();
|
||||
IBlockData iblockdata = world.getBlockState(blockposition);
|
||||
|
||||
- return shouldSolidify(world, blockposition, iblockdata) ? this.concrete : super.getStateForPlacement(blockactioncontext);
|
||||
- return shouldSolidify(world, blockposition, iblockdata) ? this.concrete.defaultBlockState() : super.getStateForPlacement(blockactioncontext);
|
||||
+ // CraftBukkit start
|
||||
+ if (!shouldSolidify(world, blockposition, iblockdata)) {
|
||||
+ return super.getStateForPlacement(blockactioncontext);
|
||||
@@ -34,7 +34,7 @@
|
||||
+
|
||||
+ // TODO: An event factory call for methods like this
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(world, blockposition);
|
||||
+ blockState.setData(this.concrete);
|
||||
+ blockState.setData(this.concrete.defaultBlockState());
|
||||
+
|
||||
+ BlockFormEvent event = new BlockFormEvent(blockState.getBlock(), blockState);
|
||||
+ world.getServer().server.getPluginManager().callEvent(event);
|
||||
@@ -48,19 +48,19 @@
|
||||
}
|
||||
|
||||
private static boolean shouldSolidify(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -70,7 +93,25 @@
|
||||
@@ -83,7 +106,25 @@
|
||||
|
||||
@Override
|
||||
public IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
- return touchesLiquid(generatoraccess, blockposition) ? this.concrete : super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
- return touchesLiquid(generatoraccess, blockposition) ? this.concrete.defaultBlockState() : super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
+ // CraftBukkit start
|
||||
+ if (touchesLiquid(generatoraccess, blockposition)) {
|
||||
+ // Suppress during worldgen
|
||||
+ if (!(generatoraccess instanceof World)) {
|
||||
+ return this.concrete;
|
||||
+ return this.concrete.defaultBlockState();
|
||||
+ }
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(generatoraccess, blockposition);
|
||||
+ blockState.setData(this.concrete);
|
||||
+ blockState.setData(this.concrete.defaultBlockState());
|
||||
+
|
||||
+ BlockFormEvent event = new BlockFormEvent(blockState.getBlock(), blockState);
|
||||
+ ((World) generatoraccess).getCraftServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCoral.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCoral.java
|
||||
@@ -25,6 +25,11 @@
|
||||
@@ -39,6 +39,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!this.scanForWater(worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCoralFan.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralFan.java
|
||||
@@ -28,6 +28,11 @@
|
||||
@@ -40,6 +40,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCoralFanWall.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralFanWall.java
|
||||
@@ -28,6 +28,11 @@
|
||||
@@ -40,6 +40,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCoralPlant.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralPlant.java
|
||||
@@ -33,6 +33,11 @@
|
||||
@@ -45,6 +45,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCrops.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCrops.java
|
||||
@@ -21,6 +21,8 @@
|
||||
@@ -22,6 +22,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
public static final int MAX_AGE = 7;
|
||||
@@ -76,7 +78,7 @@
|
||||
public static final MapCodec<BlockCrops> CODEC = simpleCodec(BlockCrops::new);
|
||||
@@ -83,7 +85,7 @@
|
||||
float f = getGrowthSpeed(this, worldserver, blockposition);
|
||||
|
||||
if (randomsource.nextInt((int) (25.0F / f) + 1) == 0) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +93,7 @@
|
||||
@@ -98,7 +100,7 @@
|
||||
i = j;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
protected int getBonemealAgeIncrease(World world) {
|
||||
@@ -153,7 +155,7 @@
|
||||
@@ -160,7 +162,7 @@
|
||||
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDaylightDetector.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDaylightDetector.java
|
||||
@@ -67,6 +67,7 @@
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
i = MathHelper.clamp(i, 0, 15);
|
||||
if ((Integer) iblockdata.getValue(BlockDaylightDetector.POWER) != i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
||||
@@ -20,6 +20,8 @@
|
||||
@@ -21,6 +21,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.ticks.TickListPriority;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
||||
@@ -52,8 +54,18 @@
|
||||
@@ -56,8 +58,18 @@
|
||||
boolean flag1 = this.shouldTurnOn(worldserver, blockposition, iblockdata);
|
||||
|
||||
if (flag && !flag1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
||||
@@ -40,6 +40,11 @@
|
||||
@@ -44,6 +44,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!canBeGrass(iblockdata, worldserver, blockposition)) {
|
||||
@@ -12,7 +12,7 @@
|
||||
worldserver.setBlockAndUpdate(blockposition, Blocks.DIRT.defaultBlockState());
|
||||
} else {
|
||||
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9) {
|
||||
@@ -49,7 +54,7 @@
|
||||
@@ -53,7 +58,7 @@
|
||||
BlockPosition blockposition1 = blockposition.offset(randomsource.nextInt(3) - 1, randomsource.nextInt(5) - 3, randomsource.nextInt(3) - 1);
|
||||
|
||||
if (worldserver.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, worldserver, blockposition1)) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
||||
@@ -48,6 +48,7 @@
|
||||
@@ -49,6 +49,7 @@
|
||||
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
||||
});
|
||||
private static final int TRIGGER_DURATION = 4;
|
||||
+ public static boolean eventFired = false; // CraftBukkit
|
||||
|
||||
public static void registerBehavior(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
|
||||
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.asItem(), idispensebehavior);
|
||||
@@ -79,7 +80,7 @@
|
||||
@Override
|
||||
public MapCodec<? extends BlockDispenser> codec() {
|
||||
@@ -85,7 +86,7 @@
|
||||
}
|
||||
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDispenser.LOGGER.warn("Ignoring dispensing attempt for Dispenser without matching block entity at {}", blockposition);
|
||||
@@ -95,6 +96,7 @@
|
||||
@@ -101,6 +102,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDoor.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDoor.java
|
||||
@@ -33,6 +33,8 @@
|
||||
@@ -37,6 +37,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockDoor extends Block {
|
||||
|
||||
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
||||
@@ -189,9 +191,24 @@
|
||||
public static final MapCodec<BlockDoor> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
||||
@@ -220,9 +222,24 @@
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDragonEgg.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDragonEgg.java
|
||||
@@ -16,6 +16,8 @@
|
||||
@@ -17,6 +17,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockDragonEgg extends BlockFalling {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
|
||||
@@ -47,6 +49,18 @@
|
||||
public static final MapCodec<BlockDragonEgg> CODEC = simpleCodec(BlockDragonEgg::new);
|
||||
@@ -54,6 +56,18 @@
|
||||
BlockPosition blockposition1 = blockposition.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
|
||||
|
||||
if (world.getBlockState(blockposition1).isAir() && worldborder.isWithinBounds(blockposition1)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDropper.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDropper.java
|
||||
@@ -18,10 +18,16 @@
|
||||
@@ -19,11 +19,17 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
public class BlockDropper extends BlockDispenser {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final MapCodec<BlockDropper> CODEC = simpleCodec(BlockDropper::new);
|
||||
- private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem();
|
||||
+ private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem(true); // CraftBukkit
|
||||
|
||||
public BlockDropper(BlockBase.Info blockbase_info) {
|
||||
super(blockbase_info);
|
||||
@@ -39,7 +45,7 @@
|
||||
@Override
|
||||
public MapCodec<BlockDropper> codec() {
|
||||
@@ -46,7 +52,7 @@
|
||||
|
||||
@Override
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDropper.LOGGER.warn("Ignoring dispensing attempt for Dropper without matching block entity at {}", blockposition);
|
||||
@@ -60,8 +66,25 @@
|
||||
@@ -67,8 +73,25 @@
|
||||
if (iinventory == null) {
|
||||
itemstack1 = BlockDropper.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
+++ b/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
@@ -19,6 +19,13 @@
|
||||
@@ -21,6 +21,13 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
+
|
||||
public class BlockEnderPortal extends BlockTileEntity {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 6.0D, 0.0D, 16.0D, 12.0D, 16.0D);
|
||||
@@ -40,13 +47,22 @@
|
||||
public static final MapCodec<BlockEnderPortal> CODEC = simpleCodec(BlockEnderPortal::new);
|
||||
@@ -48,13 +55,22 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (world instanceof WorldServer && entity.canChangeDimensions() && VoxelShapes.joinIsNotEmpty(VoxelShapes.create(entity.getBoundingBox().move((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
@@ -140,6 +140,17 @@
|
||||
@@ -168,6 +168,17 @@
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
if (!world.isClientSide) {
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFire.java
|
||||
@@ -28,6 +28,14 @@
|
||||
@@ -29,6 +29,14 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
+
|
||||
public class BlockFire extends BlockFireAbstract {
|
||||
|
||||
public static final int MAX_AGE = 15;
|
||||
@@ -93,7 +101,24 @@
|
||||
public static final MapCodec<BlockFire> CODEC = simpleCodec(BlockFire::new);
|
||||
@@ -100,7 +108,24 @@
|
||||
|
||||
@Override
|
||||
public IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,7 +167,7 @@
|
||||
@@ -149,7 +174,7 @@
|
||||
worldserver.scheduleTick(blockposition, (Block) this, getFireTickDelay(worldserver.random));
|
||||
if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
|
||||
if (!iblockdata.canSurvive(worldserver, blockposition)) {
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition.below());
|
||||
@@ -150,7 +175,7 @@
|
||||
@@ -157,7 +182,7 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockFire.AGE);
|
||||
|
||||
if (!flag && worldserver.isRaining() && this.isNearRain(worldserver, blockposition) && randomsource.nextFloat() < 0.2F + (float) i * 0.03F) {
|
||||
@@ -59,7 +59,7 @@
|
||||
} else {
|
||||
int j = Math.min(15, i + randomsource.nextInt(3) / 2);
|
||||
|
||||
@@ -164,14 +189,14 @@
|
||||
@@ -171,14 +196,14 @@
|
||||
BlockPosition blockposition1 = blockposition.below();
|
||||
|
||||
if (!worldserver.getBlockState(blockposition1).isFaceSturdy(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
|
||||
@@ -76,7 +76,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -179,12 +204,14 @@
|
||||
@@ -186,12 +211,14 @@
|
||||
boolean flag1 = worldserver.getBiome(blockposition).is(BiomeTags.INCREASED_FIRE_BURNOUT);
|
||||
int k = flag1 ? -50 : 0;
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
|
||||
for (int l = -1; l <= 1; ++l) {
|
||||
@@ -210,7 +237,15 @@
|
||||
@@ -217,7 +244,15 @@
|
||||
if (i2 > 0 && randomsource.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.isNearRain(worldserver, blockposition_mutableblockposition))) {
|
||||
int j2 = Math.min(15, i + randomsource.nextInt(5) / 4);
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,12 +269,28 @@
|
||||
@@ -241,12 +276,28 @@
|
||||
return iblockdata.hasProperty(BlockProperties.WATERLOGGED) && (Boolean) iblockdata.getValue(BlockProperties.WATERLOGGED) ? 0 : this.igniteOdds.getInt(iblockdata.getBlock());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFireAbstract.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFireAbstract.java
|
||||
@@ -123,7 +123,14 @@
|
||||
@@ -127,7 +127,14 @@
|
||||
if (!entity.fireImmune()) {
|
||||
entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
|
||||
if (entity.getRemainingFireTicks() == 0) {
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,14 +151,14 @@
|
||||
@@ -148,14 +155,14 @@
|
||||
}
|
||||
|
||||
if (!iblockdata.canSurvive(world, blockposition)) {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,4 +206,12 @@
|
||||
@@ -203,4 +210,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFluids.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFluids.java
|
||||
@@ -142,14 +142,20 @@
|
||||
@@ -39,7 +39,7 @@
|
||||
public class BlockFluids extends Block implements IFluidSource {
|
||||
|
||||
private static final Codec<FluidTypeFlowing> FLOWING_FLUID = BuiltInRegistries.FLUID.byNameCodec().comapFlatMap((fluidtype) -> {
|
||||
- DataResult dataresult;
|
||||
+ DataResult<FluidTypeFlowing> dataresult; // CraftBukkit - decompile error
|
||||
|
||||
if (fluidtype instanceof FluidTypeFlowing) {
|
||||
FluidTypeFlowing fluidtypeflowing = (FluidTypeFlowing) fluidtype;
|
||||
@@ -174,14 +174,20 @@
|
||||
if (world.getFluidState(blockposition1).is(TagsFluid.WATER)) {
|
||||
Block block = world.getFluidState(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFungi.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFungi.java
|
||||
@@ -59,6 +59,13 @@
|
||||
@@ -74,6 +74,13 @@
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
this.getFeature(worldserver).ifPresent((holder) -> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockGrassPath.java
|
||||
+++ b/net/minecraft/world/level/block/BlockGrassPath.java
|
||||
@@ -44,6 +44,11 @@
|
||||
@@ -51,6 +51,11 @@
|
||||
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockGrowingTop.java
|
||||
+++ b/net/minecraft/world/level/block/BlockGrowingTop.java
|
||||
@@ -44,7 +44,7 @@
|
||||
@@ -48,7 +48,7 @@
|
||||
BlockPosition blockposition1 = blockposition.relative(this.growthDirection);
|
||||
|
||||
if (this.canGrowInto(worldserver.getBlockState(blockposition1))) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockIce.java
|
||||
+++ b/net/minecraft/world/level/block/BlockIce.java
|
||||
@@ -51,6 +51,11 @@
|
||||
@@ -59,6 +59,11 @@
|
||||
}
|
||||
|
||||
protected void melt(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLeaves.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLeaves.java
|
||||
@@ -24,6 +24,8 @@
|
||||
@@ -25,6 +25,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockLeaves extends Block implements IBlockWaterlogged {
|
||||
|
||||
public static final int DECAY_DISTANCE = 7;
|
||||
@@ -50,6 +52,14 @@
|
||||
public static final MapCodec<BlockLeaves> CODEC = simpleCodec(BlockLeaves::new);
|
||||
@@ -57,6 +59,14 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (this.decaying(iblockdata)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLectern.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLectern.java
|
||||
@@ -200,12 +200,13 @@
|
||||
@@ -207,12 +207,13 @@
|
||||
}
|
||||
|
||||
private void popBook(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLever.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLever.java
|
||||
@@ -24,6 +24,8 @@
|
||||
@@ -28,6 +28,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+
|
||||
public class BlockLever extends BlockAttachable {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -91,6 +93,20 @@
|
||||
public static final MapCodec<BlockLever> CODEC = simpleCodec(BlockLever::new);
|
||||
@@ -101,6 +103,20 @@
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMagma.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMagma.java
|
||||
@@ -23,7 +23,9 @@
|
||||
@@ -30,7 +30,9 @@
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
|
||||
if (!entity.isSteppingCarefully() && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user