Skip to content

Commit

Permalink
Revert "1.20.2-rc1"
Browse files Browse the repository at this point in the history
This reverts commit f7cca8f
  • Loading branch information
C0D3-M4513R committed Jan 13, 2024
1 parent d9c49d1 commit 52538d3
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 98 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[![craftbukkit-version][]][craftbukkit-commit]
[![spigot-version][]][spigot-commit]

at commit (done): 145df60b
at commit (done): f7cca8fb
maybe todo commits for build/fmlloader system until 1.20.1:
- e34090c8
- e00de1a3
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

JAVA_VERSION=17
MC_VERSION=1.20.2-rc1
MC_VERSION=1.20.2-pre4
FORGE_VERSION=48.1.0
KETTING_VERSION=0.0.1
MC_NEXT_VERSION=1.21
MCP_VERSION=20230915.121641
MCP_VERSION=20230913.141520
MAPPING_CHANNEL=official
MAPPING_VERSION=1.20.2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
@@ -181,13 +_,23 @@
@@ -183,13 +_,23 @@
}

private void doLoadLevel(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_) {
Expand All @@ -24,7 +24,7 @@
} catch (Exception exception) {
LOGGER.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception);
if (!p_233148_) {
@@ -207,7 +_,9 @@
@@ -209,7 +_,9 @@
WorldData worlddata = worldstem.worldData();
boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld();
boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable();
Expand All @@ -35,7 +35,7 @@
this.minecraft.getDownloadedPackSource().loadBundledResourcePack(levelstoragesource$levelstorageaccess).thenApply((p_233177_) -> {
return true;
}).exceptionallyComposeAsync((p_233183_) -> {
@@ -229,9 +_,11 @@
@@ -231,9 +_,11 @@
return null;
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@
- if (blockstate.getBlock() instanceof TntBlock) {
- TntBlock.explode(level, blockpos);
- level.removeBlock(blockpos, false);
+ if (blockstate.isFlammable(level, blockpos, p_123412_.state().getValue(DispenserBlock.FACING).getOpposite())) {
+ if (blockstate.isFlammable(level, blockpos, p_123412_.getBlockState().getValue(DispenserBlock.FACING).getOpposite())) {
+ if (blockstate.getBlock() instanceof TntBlock) {
+ // CraftBukkit - TNTPrimeEvent
+ if (org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory.callTNTPrimeEvent(level, blockpos, org.bukkit.event.block.TNTPrimeEvent.PrimeCause.DISPENSER, null, p_123412_.pos())) {
+ blockstate.onCaughtFire(level, blockpos, p_123412_.state().getValue(DispenserBlock.FACING).getOpposite(), null);
+ blockstate.onCaughtFire(level, blockpos, p_123412_.getBlockState().getValue(DispenserBlock.FACING).getOpposite(), null);
+ level.removeBlock(blockpos, false);
+ }
+ } else {
Expand Down
5 changes: 2 additions & 3 deletions patches/minecraft/net/minecraft/nbt/ByteArrayTag.java.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--- a/net/minecraft/nbt/ByteArrayTag.java
+++ b/net/minecraft/nbt/ByteArrayTag.java
@@ -21,6 +_,8 @@
@@ -21,6 +_,7 @@
private static byte[] readAccounted(DataInput p_301772_, NbtAccounter p_301697_) throws IOException {
p_301697_.accountBytes(24L);
int i = p_301772_.readInt();
+ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); // Spigot
+
p_301697_.accountBytes(1L, (long)i);
p_301697_.accountBytes(1L * (long)i);
byte[] abyte = new byte[i];
p_301772_.readFully(abyte);
2 changes: 1 addition & 1 deletion patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/nbt/CompoundTag.java
+++ b/net/minecraft/nbt/CompoundTag.java
@@ -204,6 +_,7 @@
@@ -210,6 +_,7 @@

@Nullable
public Tag put(String p_128366_, Tag p_128367_) {
Expand Down
5 changes: 2 additions & 3 deletions patches/minecraft/net/minecraft/nbt/IntArrayTag.java.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--- a/net/minecraft/nbt/IntArrayTag.java
+++ b/net/minecraft/nbt/IntArrayTag.java
@@ -21,6 +_,8 @@
@@ -21,6 +_,7 @@
private static int[] readAccounted(DataInput p_301738_, NbtAccounter p_301754_) throws IOException {
p_301754_.accountBytes(24L);
int i = p_301738_.readInt();
+ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); // Spigot
+
p_301754_.accountBytes(4L, (long)i);
p_301754_.accountBytes(4L * (long)i);
int[] aint = new int[i];

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/nbt/NbtAccounter.java
+++ b/net/minecraft/nbt/NbtAccounter.java
@@ -50,6 +_,36 @@
@@ -43,6 +_,36 @@
}
}

Expand Down
2 changes: 1 addition & 1 deletion patches/minecraft/net/minecraft/nbt/NbtIo.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Tag tag = readUnnamedTag(p_128935_, p_128936_);
if (tag instanceof CompoundTag) {
return (CompoundTag)tag;
@@ -154,10 +_,12 @@
@@ -155,10 +_,12 @@

private static Tag readUnnamedTag(DataInput p_128931_, NbtAccounter p_128933_) throws IOException {
byte b0 = p_128931_.readByte();
Expand Down
2 changes: 1 addition & 1 deletion patches/minecraft/net/minecraft/nbt/StringTag.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
private static String readAccounted(DataInput p_301750_, NbtAccounter p_301732_) throws IOException {
p_301732_.accountBytes(36L);
String s = p_301750_.readUTF();
- p_301732_.accountBytes(2L, (long)s.length());
- p_301732_.accountBytes(2L * (long)s.length());
+ p_301732_.readUTF(s);
return s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

-public abstract class AbstractMinecart extends Entity {
+public abstract class AbstractMinecart extends Entity implements net.minecraftforge.common.extensions.IForgeAbstractMinecart {
private static final float PASSENGER_ATTACHMENT_Y = 0.1875F;
private static final EntityDataAccessor<Integer> DATA_ID_HURT = SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.INT);
private static final EntityDataAccessor<Integer> DATA_ID_HURTDIR = SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.INT);
@@ -85,6 +_,19 @@
private static final EntityDataAccessor<Float> DATA_ID_DAMAGE = SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.FLOAT);
@@ -84,6 +_,19 @@
p_38135_.put(RailShape.NORTH_WEST, Pair.of(vec3i2, vec3i));
p_38135_.put(RailShape.NORTH_EAST, Pair.of(vec3i2, vec3i1));
});
Expand All @@ -29,7 +29,7 @@

protected AbstractMinecart(EntityType<?> p_38087_, Level p_38088_) {
super(p_38087_, p_38088_);
@@ -99,6 +_,14 @@
@@ -98,6 +_,14 @@
this.zo = p_38094_;
}

Expand All @@ -44,7 +44,7 @@
public static AbstractMinecart createMinecart(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) {
if (p_38124_ == AbstractMinecart.Type.CHEST) {
return new MinecartChest(p_38120_, p_38121_, p_38122_, p_38123_);
@@ -133,7 +_,7 @@
@@ -132,7 +_,7 @@
}

public boolean isPushable() {
Expand All @@ -53,7 +53,7 @@
}

protected Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) {
@@ -200,6 +_,19 @@
@@ -199,6 +_,19 @@
if (this.isInvulnerableTo(p_38117_)) {
return false;
} else {
Expand All @@ -73,7 +73,7 @@
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.markHurt();
@@ -207,6 +_,15 @@
@@ -206,6 +_,15 @@
this.gameEvent(GameEvent.ENTITY_DAMAGE, p_38117_.getEntity());
boolean flag = p_38117_.getEntity() instanceof Player && ((Player)p_38117_.getEntity()).getAbilities().instabuild;
if (flag || this.getDamage() > 40.0F) {
Expand Down Expand Up @@ -104,7 +104,7 @@
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
@@ -270,7 +_,7 @@
@@ -269,7 +_,7 @@
}

this.checkBelowWorld();
Expand All @@ -113,7 +113,7 @@
if (this.level().isClientSide) {
if (this.lerpSteps > 0) {
this.lerpPositionAndRotationStep(this.lerpSteps, this.lerpX, this.lerpY, this.lerpZ, this.lerpYRot, this.lerpXRot);
@@ -296,9 +_,9 @@
@@ -295,9 +_,9 @@
BlockPos blockpos = new BlockPos(k, i, j);
BlockState blockstate = this.level().getBlockState(blockpos);
this.onRails = BaseRailBlock.isRail(blockstate);
Expand All @@ -125,7 +125,7 @@
this.activateMinecart(k, i, j, blockstate.getValue(PoweredRailBlock.POWERED));
}
} else {
@@ -323,20 +_,61 @@
@@ -322,20 +_,61 @@
}

this.setRot(this.getYRot(), this.getXRot());
Expand Down Expand Up @@ -229,7 +229,7 @@
}

}
@@ -383,18 +_,19 @@
@@ -382,18 +_,19 @@
d1 = (double)p_38156_.getY();
boolean flag = false;
boolean flag1 = false;
Expand All @@ -252,7 +252,7 @@
switch (railshape) {
case ASCENDING_EAST:
this.setDeltaMovement(vec31.add(-d3, 0.0D, 0.0D));
@@ -440,7 +_,7 @@
@@ -439,7 +_,7 @@
}
}

Expand All @@ -261,7 +261,7 @@
double d22 = this.getDeltaMovement().horizontalDistance();
if (d22 < 0.03D) {
this.setDeltaMovement(Vec3.ZERO);
@@ -469,10 +_,7 @@
@@ -468,10 +_,7 @@
d0 = d23 + d4 * d14;
d2 = d10 + d5 * d14;
this.setPos(d0, d1, d2);
Expand All @@ -273,7 +273,7 @@
if (vec3i.getY() != 0 && Mth.floor(this.getX()) - p_38156_.getX() == vec3i.getX() && Mth.floor(this.getZ()) - p_38156_.getZ() == vec3i.getZ()) {
this.setPos(this.getX(), this.getY() + (double)vec3i.getY(), this.getZ());
} else if (vec3i1.getY() != 0 && Mth.floor(this.getX()) - p_38156_.getX() == vec3i1.getX() && Mth.floor(this.getZ()) - p_38156_.getZ() == vec3i1.getZ()) {
@@ -500,7 +_,10 @@
@@ -499,7 +_,10 @@
this.setDeltaMovement(d26 * (double)(j - p_38156_.getX()), vec35.y, d26 * (double)(i - p_38156_.getZ()));
}

Expand All @@ -285,7 +285,7 @@
Vec3 vec36 = this.getDeltaMovement();
double d27 = vec36.horizontalDistance();
if (d27 > 0.01D) {
@@ -543,7 +_,7 @@
@@ -542,7 +_,7 @@
}

protected void applyNaturalSlowdown() {
Expand All @@ -294,7 +294,7 @@
Vec3 vec3 = this.getDeltaMovement();
vec3 = vec3.multiply(d0, 0.0D, d0);
if (this.isInWater()) {
@@ -564,7 +_,7 @@
@@ -563,7 +_,7 @@

BlockState blockstate = this.level().getBlockState(new BlockPos(i, j, k));
if (BaseRailBlock.isRail(blockstate)) {
Expand All @@ -303,7 +303,7 @@
p_38098_ = (double)j;
if (railshape.isAscending()) {
p_38098_ = (double)(j + 1);
@@ -603,7 +_,7 @@
@@ -602,7 +_,7 @@

BlockState blockstate = this.level().getBlockState(new BlockPos(i, j, k));
if (BaseRailBlock.isRail(blockstate)) {
Expand All @@ -312,7 +312,7 @@
Pair<Vec3i, Vec3i> pair = exits(railshape);
Vec3i vec3i = pair.getFirst();
Vec3i vec3i1 = pair.getSecond();
@@ -665,9 +_,21 @@
@@ -664,9 +_,21 @@
}

public void push(Entity p_38165_) {
Expand All @@ -334,7 +334,7 @@
double d0 = p_38165_.getX() - this.getX();
double d1 = p_38165_.getZ() - this.getZ();
double d2 = d0 * d0 + d1 * d1;
@@ -698,11 +_,11 @@
@@ -697,11 +_,11 @@

Vec3 vec32 = this.getDeltaMovement();
Vec3 vec33 = p_38165_.getDeltaMovement();
Expand All @@ -348,7 +348,7 @@
p_38165_.setDeltaMovement(vec33.multiply(0.2D, 1.0D, 0.2D));
p_38165_.push(vec32.x + d0, 0.0D, vec32.z + d1);
this.setDeltaMovement(vec32.multiply(0.95D, 1.0D, 0.95D));
@@ -819,7 +_,43 @@
@@ -818,7 +_,43 @@
public void setCustomDisplay(boolean p_38139_) {
this.getEntityData().set(DATA_ID_CUSTOM_DISPLAY, p_38139_);
}
Expand Down Expand Up @@ -392,7 +392,7 @@
public ItemStack getPickResult() {
Item item;
switch (this.getMinecartType()) {
@@ -854,4 +_,26 @@
@@ -853,4 +_,26 @@
HOPPER,
COMMAND_BLOCK;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
--- a/net/minecraft/world/level/block/BeehiveBlock.java
+++ b/net/minecraft/world/level/block/BeehiveBlock.java
@@ -72,6 +_,10 @@
@@ -70,6 +_,9 @@
public int getAnalogOutputSignal(BlockState p_49620_, Level p_49621_, BlockPos p_49622_) {
return p_49620_.getValue(HONEY_LEVEL);
}

+ // Forge: Fixed MC-227255 Beehives and bee nests do not rotate/mirror correctly in structure blocks
+ @Override public BlockState rotate(BlockState blockState, net.minecraft.world.level.block.Rotation rotation) { return blockState.setValue(FACING, rotation.rotate(blockState.getValue(FACING))); }
+ @Override public BlockState mirror(BlockState blockState, net.minecraft.world.level.block.Mirror mirror) { return blockState.rotate(mirror.getRotation(blockState.getValue(FACING))); }
+
public void playerDestroy(Level p_49584_, Player p_49585_, BlockPos p_49586_, BlockState p_49587_, @Nullable BlockEntity p_49588_, ItemStack p_49589_) {
super.playerDestroy(p_49584_, p_49585_, p_49586_, p_49587_, p_49588_, p_49589_);
if (!p_49584_.isClientSide && p_49588_ instanceof BeehiveBlockEntity beehiveblockentity) {
@@ -98,7 +_,7 @@
@@ -89,5 +_,6 @@
List<Bee> list = p_49650_.getEntitiesOfClass(Bee.class, (new AABB(p_49651_)).inflate(8.0D, 6.0D, 8.0D));
if (!list.isEmpty()) {
List<Player> list1 = p_49650_.getEntitiesOfClass(Player.class, (new AABB(p_49651_)).inflate(8.0D, 6.0D, 8.0D));
+ if (list1.isEmpty()) return; //Forge: Prevent Error when no players are around.
int i = list1.size();

@@ -94,6 +_,6 @@
for(Bee bee : list) {
if (bee.getTarget() == null) {
Player player = Util.getRandom(list1, p_49650_.random);
- bee.setTarget(player);
- bee.setTarget(list1.get(p_49650_.random.nextInt(i)));
+ bee.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
}
}
}
@@ -115,7 +_,7 @@
@@ -110,7 +_,7 @@
boolean flag = false;
if (i >= 5) {
Item item = itemstack.getItem();
Expand Down
Loading

0 comments on commit 52538d3

Please sign in to comment.