1.21.6 dev

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
Bjarne Koll
2025-05-28 13:23:32 +02:00
committed by Nassim Jahnke
parent 39203a65e0
commit a24f9b204c
788 changed files with 41006 additions and 6324 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/AbstractBoat.java
+++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java
@@ -79,6 +_,15 @@
@@ -80,6 +_,15 @@
private Leashable.LeashData leashData;
private final Supplier<Item> dropItem;
@@ -16,7 +16,7 @@
public AbstractBoat(EntityType<? extends AbstractBoat> entityType, Level level, Supplier<Item> dropItem) {
super(entityType, level);
this.dropItem = dropItem;
@@ -120,7 +_,7 @@
@@ -121,7 +_,7 @@
}
@Override
@@ -25,7 +25,7 @@
return true;
}
@@ -175,11 +_,30 @@
@@ -176,11 +_,30 @@
@Override
public void push(Entity entity) {
@@ -56,7 +56,7 @@
super.push(entity);
}
}
@@ -246,6 +_,18 @@
@@ -247,6 +_,18 @@
this.setDeltaMovement(Vec3.ZERO);
}
@@ -75,7 +75,7 @@
this.applyEffectsFromBlocks();
this.applyEffectsFromBlocks();
this.tickBubbleColumn();
@@ -548,7 +_,7 @@
@@ -551,7 +_,7 @@
this.waterLevel = this.getY(1.0);
double d2 = this.getWaterLevelAbove() - this.getBbHeight() + 0.101;
if (this.level().noCollision(this, this.getBoundingBox().move(0.0, d2 - this.getY(), 0.0))) {
@@ -84,7 +84,7 @@
this.setDeltaMovement(this.getDeltaMovement().multiply(1.0, 0.0, 1.0));
this.lastYd = 0.0;
}
@@ -711,12 +_,12 @@
@@ -714,12 +_,12 @@
}
@Override

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
+++ b/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
@@ -65,12 +_,12 @@
@@ -66,12 +_,12 @@
}
@Override
@@ -15,7 +15,7 @@
}
@Override
@@ -97,8 +_,8 @@
@@ -94,8 +_,8 @@
@Override
public void openCustomInventoryScreen(Player player) {
@@ -26,7 +26,7 @@
this.gameEvent(GameEvent.CONTAINER_OPEN, player);
PiglinAi.angerNearbyPiglins(serverLevel, player, true);
}
@@ -151,7 +_,7 @@
@@ -148,7 +_,7 @@
@Nullable
@Override
public AbstractContainerMenu createMenu(int containerId, Inventory playerInventory, Player player) {
@@ -35,7 +35,7 @@
return null;
} else {
this.unpackLootTable(playerInventory.player);
@@ -198,4 +_,58 @@
@@ -195,4 +_,58 @@
public void stopOpen(Player player) {
this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of(player));
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -94,6 +_,17 @@
@@ -93,6 +_,17 @@
}
)
);
@@ -18,7 +18,7 @@
protected AbstractMinecart(EntityType<?> entityType, Level level) {
super(entityType, level);
@@ -153,11 +_,19 @@
@@ -152,11 +_,19 @@
@Override
public boolean canCollideWith(Entity entity) {
@@ -40,7 +40,7 @@
return true;
}
@@ -258,6 +_,14 @@
@@ -257,6 +_,14 @@
@Override
public void tick() {
@@ -55,7 +55,7 @@
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
@@ -267,8 +_,20 @@
@@ -266,8 +_,20 @@
}
this.checkBelowWorld();
@@ -77,7 +77,7 @@
this.updateInWaterStateAndDoFluidPushing();
if (this.isInLava()) {
this.lavaIgnite();
@@ -350,12 +_,16 @@
@@ -356,12 +_,16 @@
Vec3 deltaMovement = this.getDeltaMovement();
this.setDeltaMovement(Mth.clamp(deltaMovement.x, -maxSpeed, maxSpeed), deltaMovement.y, Mth.clamp(deltaMovement.z, -maxSpeed, maxSpeed));
if (this.onGround()) {
@@ -96,20 +96,12 @@
}
}
@@ -386,6 +_,7 @@
public void applyEffectsFromBlocks() {
if (!useExperimentalMovement(this.level())) {
this.applyEffectsFromBlocks(this.position(), this.position());
+ this.clearMovementsThisTick(); // Paper - MC-296337
} else {
super.applyEffectsFromBlocks();
}
@@ -457,6 +_,15 @@
this.setDisplayOffset(compound.getIntOr("DisplayOffset", this.getDefaultDisplayOffset()));
this.flipped = compound.getBooleanOr("FlippedRotation", false);
this.firstTick = compound.getBooleanOr("HasTicked", false);
@@ -463,6 +_,15 @@
this.setDisplayOffset(input.getIntOr("DisplayOffset", this.getDefaultDisplayOffset()));
this.flipped = input.getBooleanOr("FlippedRotation", false);
this.firstTick = input.getBooleanOr("HasTicked", false);
+ // Paper start - Friction API
+ compound.getString("Paper.FrictionState").ifPresent(frictionState -> {
+ input.getString("Paper.FrictionState").ifPresent(frictionState -> {
+ try {
+ this.frictionState = net.kyori.adventure.util.TriState.valueOf(frictionState);
+ } catch (Exception ignored) {
@@ -120,14 +112,13 @@
}
@Override
@@ -472,13 +_,27 @@
@@ -475,13 +_,26 @@
compound.putBoolean("FlippedRotation", this.flipped);
compound.putBoolean("HasTicked", this.firstTick);
+
output.putBoolean("FlippedRotation", this.flipped);
output.putBoolean("HasTicked", this.firstTick);
+ // Paper start - Friction API
+ if (this.frictionState != net.kyori.adventure.util.TriState.NOT_SET) {
+ compound.putString("Paper.FrictionState", this.frictionState.toString());
+ output.putString("Paper.FrictionState", this.frictionState.toString());
+ }
+ // Paper end - Friction API
}
@@ -148,7 +139,7 @@
double d = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double d2 = d * d + d1 * d1;
@@ -587,4 +_,26 @@
@@ -590,4 +_,26 @@
public boolean isFurnace() {
return false;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
@@ -21,10 +_,11 @@
@@ -22,10 +_,11 @@
import net.minecraft.world.phys.Vec3;
public abstract class AbstractMinecartContainer extends AbstractMinecart implements ContainerEntity {
@@ -13,7 +13,7 @@
protected AbstractMinecartContainer(EntityType<?> entityType, Level level) {
super(entityType, level);
@@ -71,12 +_,12 @@
@@ -72,12 +_,12 @@
}
@Override
@@ -28,7 +28,7 @@
}
@Override
@@ -164,4 +_,56 @@
@@ -165,4 +_,56 @@
public void clearItemStacks() {
this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
}

View File

@@ -1,32 +1,32 @@
--- a/net/minecraft/world/entity/vehicle/ContainerEntity.java
+++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java
@@ -60,12 +_,12 @@
default void addChestVehicleSaveData(CompoundTag tag, HolderLookup.Provider levelRegistry) {
default void addChestVehicleSaveData(ValueOutput output) {
if (this.getContainerLootTable() != null) {
tag.putString("LootTable", this.getContainerLootTable().location().toString());
+ this.lootableData().saveNbt(tag); // Paper
output.putString("LootTable", this.getContainerLootTable().location().toString());
+ this.lootableData().saveNbt(output); // Paper
if (this.getContainerLootTableSeed() != 0L) {
tag.putLong("LootTableSeed", this.getContainerLootTableSeed());
output.putLong("LootTableSeed", this.getContainerLootTableSeed());
}
- } else {
- ContainerHelper.saveAllItems(tag, this.getItemStacks(), levelRegistry);
- ContainerHelper.saveAllItems(output, this.getItemStacks());
}
+ ContainerHelper.saveAllItems(tag, this.getItemStacks(), levelRegistry); // Paper - always save the items, table may still remain
+ ContainerHelper.saveAllItems(output, this.getItemStacks()); // Paper - always save the items, table may still remain
}
default void readChestVehicleSaveData(CompoundTag tag, HolderLookup.Provider levelRegistry) {
default void readChestVehicleSaveData(ValueInput input) {
@@ -73,7 +_,12 @@
ResourceKey<LootTable> resourceKey = tag.read("LootTable", LootTable.KEY_CODEC).orElse(null);
ResourceKey<LootTable> resourceKey = input.read("LootTable", LootTable.KEY_CODEC).orElse(null);
this.setContainerLootTable(resourceKey);
this.setContainerLootTableSeed(tag.getLongOr("LootTableSeed", 0L));
this.setContainerLootTableSeed(input.getLongOr("LootTableSeed", 0L));
- if (resourceKey == null) {
+ // Paper start - LootTable API
+ if (this.getContainerLootTable() != null) {
+ this.lootableData().loadNbt(tag);
+ this.lootableData().loadNbt(input);
+ }
+ // Paper end - LootTable API
+ if (true || resourceKey == null) { // Paper - always read the items, table may still remain
ContainerHelper.loadAllItems(tag, this.getItemStacks(), levelRegistry);
ContainerHelper.loadAllItems(input, this.getItemStacks());
}
}
@@ -89,19 +_,27 @@

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
+++ b/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
@@ -126,7 +_,7 @@
@@ -127,7 +_,7 @@
MinecartCommandBlock.this.position(),
MinecartCommandBlock.this.getRotationVector(),
this.getLevel(),
@@ -9,7 +9,7 @@
this.getName().getString(),
MinecartCommandBlock.this.getDisplayName(),
this.getLevel().getServer(),
@@ -138,5 +_,12 @@
@@ -139,5 +_,12 @@
public boolean isValid() {
return !MinecartCommandBlock.this.isRemoved();
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/MinecartTNT.java
+++ b/net/minecraft/world/entity/vehicle/MinecartTNT.java
@@ -38,6 +_,7 @@
@@ -39,6 +_,7 @@
public int fuse = -1;
public float explosionPowerBase = 4.0F;
public float explosionSpeedFactor = 1.0F;
@@ -8,7 +8,7 @@
public MinecartTNT(EntityType<? extends MinecartTNT> entityType, Level level) {
super(entityType, level);
@@ -52,6 +_,12 @@
@@ -53,6 +_,12 @@
public void tick() {
super.tick();
if (this.fuse > 0) {
@@ -21,7 +21,7 @@
this.fuse--;
this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5, this.getZ(), 0.0, 0.0, 0.0);
} else if (this.fuse == 0) {
@@ -107,6 +_,17 @@
@@ -108,6 +_,17 @@
if (this.level() instanceof ServerLevel serverLevel) {
if (serverLevel.getGameRules().getBoolean(GameRules.RULE_TNT_EXPLODES)) {
double min = Math.min(Math.sqrt(radiusModifier), 5.0);
@@ -39,7 +39,7 @@
serverLevel.explode(
this,
damageSource,
@@ -114,13 +_,13 @@
@@ -115,13 +_,13 @@
this.getX(),
this.getY(),
this.getZ(),