Skip to content

Commit

Permalink
Merge branch '1.21.x' into text_rendertype
Browse files Browse the repository at this point in the history
  • Loading branch information
XFactHD authored Oct 23, 2024
2 parents ffaf572 + dd989e5 commit ad501ae
Show file tree
Hide file tree
Showing 33 changed files with 779 additions and 761 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
run: ./gradlew assemble checkFormatting

- name: Run JCC
if: ${{ ! startsWith(github.event.pull_request.head.ref, 'port/') && ! startsWith(github.ref_name, 'port/') }}
if: ${{ ! startsWith(github.event.pull_request.head.ref, 'port/') && ! startsWith(github.ref_name, 'port/') && ! startsWith(github.event.pull_request.base.ref, 'port/') }}
run: ./gradlew checkJarCompatibility

- name: Upload JCC
if: ${{ ! startsWith(github.event.pull_request.head.ref, 'port/') && ! startsWith(github.ref_name, 'port/') }}
if: ${{ ! startsWith(github.event.pull_request.head.ref, 'port/') && ! startsWith(github.ref_name, 'port/') && ! startsWith(github.event.pull_request.base.ref, 'port/') }}
uses: neoforged/action-jar-compatibility/upload@v1

- name: Publish artifacts
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ org.gradle.debug=false

java_version=21

minecraft_version=1.21.2-rc1
neoform_version=20241017.134216
minecraft_version=1.21.3
neoform_version=20241023.131943
# on snapshot versions, used to prefix the version
neoforge_snapshot_next_stable=21.2
neoforge_snapshot_next_stable=21.4

mergetool_version=2.0.0
accesstransformers_version=10.0.1
Expand Down
8 changes: 8 additions & 0 deletions patches/net/minecraft/client/KeyboardHandler.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
return;
}
}
@@ -507,6 +_,7 @@
}
}
}
+ net.neoforged.neoforge.client.ClientHooks.onKeyInput(p_90895_, p_90896_, p_90897_, p_90898_);
}
}

@@ -516,10 +_,20 @@
if (screen != null && this.minecraft.getOverlay() == null) {
try {
Expand Down
10 changes: 5 additions & 5 deletions patches/net/minecraft/server/level/ChunkMap.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
this.markPosition(p_140418_, chunkaccess.getPersistedStatus().getChunkType());
return chunkaccess;
} else {
@@ -778,6 +_,7 @@
@@ -780,6 +_,7 @@
Profiler.get().incrementCounter("chunkSave");
this.activeChunkWrites.incrementAndGet();
SerializableChunkData serializablechunkdata = SerializableChunkData.copyOf(this.level, p_140259_);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.level.ChunkDataEvent.Save(p_140259_, this.level, serializablechunkdata));
CompletableFuture<CompoundTag> completablefuture = CompletableFuture.supplyAsync(serializablechunkdata::write, Util.backgroundExecutor());
this.write(chunkpos, completablefuture::join).handle((p_381690_, p_381691_) -> {
if (p_381691_ != null) {
@@ -844,9 +_,11 @@
@@ -846,9 +_,11 @@

private static void markChunkPendingToSend(ServerPlayer p_295834_, LevelChunk p_296281_) {
p_295834_.connection.chunkSender.markChunkPendingToSend(p_296281_);
Expand All @@ -48,15 +48,15 @@
p_294215_.connection.chunkSender.dropChunk(p_294215_, p_294758_);
}

@@ -1057,6 +_,7 @@
@@ -1059,6 +_,7 @@
this.playerMap.unIgnorePlayer(p_140185_);
}

+ //PATCH 1.20.2: Figure out the firing of the watch and unwatch events when chunk tracking updates.
this.updateChunkTracking(p_140185_);
}
}
@@ -1108,7 +_,7 @@
@@ -1110,7 +_,7 @@
}

protected void addEntity(Entity p_140200_) {
Expand All @@ -65,7 +65,7 @@
EntityType<?> entitytype = p_140200_.getType();
int i = entitytype.clientTrackingRange() * 16;
if (i != 0) {
@@ -1352,5 +_,20 @@
@@ -1354,5 +_,20 @@
this.updatePlayer(serverplayer);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
this.storeInCache(i, chunkaccess1, ChunkStatus.FULL);
@@ -384,7 +_,7 @@
private void collectTickingChunks(List<LevelChunk> p_363421_) {
this.chunkMap.forEachSpawnCandidateChunk(p_370483_ -> {
LevelChunk levelchunk = p_370483_.getTickingChunk();
- if (levelchunk != null && this.level.isNaturalSpawningAllowed(p_370483_.getPos())) {
+ if (levelchunk != null && this.level.isNaturalSpawningAllowed(p_370483_.getPos()) || this.distanceManager.shouldForceTicks(p_370483_.getPos().toLong())) {
this.chunkMap.forEachSpawnCandidateChunk(p_381767_ -> {
LevelChunk levelchunk = p_381767_.getTickingChunk();
- if (levelchunk != null && this.level.isNaturalSpawningAllowed(p_381767_.getPos())) {
+ if (levelchunk != null && this.level.isNaturalSpawningAllowed(p_381767_.getPos()) || this.distanceManager.shouldForceTicks(p_381767_.getPos().toLong())) {
p_363421_.add(levelchunk);
}
});
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/util/datafix/DataFixers.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/util/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -1307,10 +_,35 @@
@@ -1308,10 +_,35 @@
Schema schema199 = p_14514_.addSchema(3800, SAME_NAMESPACED);
UnaryOperator<String> unaryoperator2 = createRenamer(Map.of("minecraft:scute", "minecraft:turtle_scute"));
p_14514_.addFixer(ItemRenameFix.create(schema199, "Rename scute item to turtle_scute", unaryoperator2));
Expand Down Expand Up @@ -36,7 +36,7 @@
Schema schema201 = p_14514_.addSchema(3807, V3807::new);
p_14514_.addFixer(new AddNewChoices(schema201, "Added Vault", References.BLOCK_ENTITY));
Schema schema202 = p_14514_.addSchema(3807, 1, SAME_NAMESPACED);
@@ -1333,6 +_,18 @@
@@ -1334,6 +_,18 @@
schema209, "Rename jump strength attribute", createRenamer("minecraft:horse.jump_strength", "minecraft:generic.jump_strength")
)
);
Expand Down
56 changes: 28 additions & 28 deletions patches/net/minecraft/world/entity/Entity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

this.checkBelowWorld();
@@ -763,12 +_,12 @@
@@ -760,12 +_,12 @@
this.setRemainingFireTicks(-this.getFireImmuneTicks());
}

Expand All @@ -63,7 +63,7 @@
this.setRemainingFireTicks(-this.getFireImmuneTicks());
}
}
@@ -848,9 +_,7 @@
@@ -845,9 +_,7 @@
return blockpos;
} else {
BlockState blockstate = this.level().getBlockState(blockpos);
Expand All @@ -74,7 +74,7 @@
? blockpos.atY(Mth.floor(this.position.y - (double)p_216987_))
: blockpos;
}
@@ -1132,19 +_,19 @@
@@ -1129,19 +_,19 @@
return !blockstate.is(BlockTags.INSIDE_STEP_SOUND_BLOCKS) && !blockstate.is(BlockTags.COMBINATION_STEP_SOUND_BLOCKS) ? p_278049_ : blockpos;
}

Expand All @@ -100,7 +100,7 @@
this.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F, soundtype.getPitch());
}

@@ -1297,20 +_,23 @@
@@ -1294,20 +_,23 @@

public void updateSwimming() {
if (this.isSwimming()) {
Expand Down Expand Up @@ -129,15 +129,15 @@
}

void updateInWaterStateAndDoWaterCurrentPushing() {
@@ -1335,6 +_,7 @@
@@ -1332,6 +_,7 @@
private void updateFluidOnEyes() {
this.wasEyeInWater = this.isEyeInFluid(FluidTags.WATER);
this.fluidOnEyes.clear();
+ this.forgeFluidTypeOnEyes = net.neoforged.neoforge.common.NeoForgeMod.EMPTY_TYPE.value();
double d0 = this.getEyeY();
if (this.getVehicle() instanceof AbstractBoat abstractboat
&& !abstractboat.isUnderWater()
@@ -1347,7 +_,7 @@
@@ -1344,7 +_,7 @@
FluidState fluidstate = this.level().getFluidState(blockpos);
double d1 = (double)((float)blockpos.getY() + fluidstate.getHeight(this.level(), blockpos));
if (d1 > d0) {
Expand All @@ -146,7 +146,7 @@
}
}

@@ -1392,12 +_,13 @@
@@ -1389,12 +_,13 @@
}

public boolean canSpawnSprintParticle() {
Expand All @@ -161,7 +161,7 @@
if (blockstate.getRenderShape() != RenderShape.INVISIBLE) {
Vec3 vec3 = this.getDeltaMovement();
BlockPos blockpos1 = this.blockPosition();
@@ -1411,16 +_,19 @@
@@ -1408,16 +_,19 @@
d1 = Mth.clamp(d1, (double)blockpos.getZ(), (double)blockpos.getZ() + 1.0);
}

Expand All @@ -183,7 +183,7 @@
}

public void moveRelative(float p_19921_, Vec3 p_19922_) {
@@ -1799,6 +_,10 @@
@@ -1796,6 +_,10 @@
p_20241_.put("Tags", listtag);
}

Expand All @@ -194,7 +194,7 @@
this.addAdditionalSaveData(p_20241_);
if (this.isVehicle()) {
ListTag listtag1 = new ListTag();
@@ -1880,6 +_,8 @@
@@ -1877,6 +_,8 @@
this.setGlowingTag(p_20259_.getBoolean("Glowing"));
this.setTicksFrozen(p_20259_.getInt("TicksFrozen"));
this.hasVisualFire = p_20259_.getBoolean("HasVisualFire");
Expand All @@ -203,7 +203,7 @@
if (p_20259_.contains("Tags", 9)) {
this.tags.clear();
ListTag listtag3 = p_20259_.getList("Tags", 8);
@@ -1962,6 +_,8 @@
@@ -1959,6 +_,8 @@
} else {
ItemEntity itementity = new ItemEntity(p_376141_, this.getX(), this.getY() + (double)p_376881_, this.getZ(), p_376472_);
itementity.setDefaultPickUpDelay();
Expand All @@ -212,7 +212,7 @@
p_376141_.addFreshEntity(itementity);
return itementity;
}
@@ -2029,7 +_,11 @@
@@ -2026,7 +_,11 @@

public void rideTick() {
this.setDeltaMovement(Vec3.ZERO);
Expand All @@ -225,23 +225,23 @@
if (this.isPassenger()) {
this.getVehicle().positionRider(this);
}
@@ -2089,6 +_,7 @@
@@ -2086,6 +_,7 @@
}
}

+ if (!net.neoforged.neoforge.event.EventHooks.canMountEntity(this, p_19966_, true)) return false;
if (p_19967_ || this.canRide(p_19966_) && p_19966_.canAddPassenger(this)) {
if (this.isPassenger()) {
this.stopRiding();
@@ -2120,6 +_,7 @@
@@ -2117,6 +_,7 @@
public void removeVehicle() {
if (this.vehicle != null) {
Entity entity = this.vehicle;
+ if (!net.neoforged.neoforge.event.EventHooks.canMountEntity(this, entity, false)) return;
this.vehicle = null;
entity.removePassenger(this);
}
@@ -2169,6 +_,8 @@
@@ -2166,6 +_,8 @@
return this.passengers.isEmpty();
}

Expand All @@ -250,7 +250,7 @@
protected boolean couldAcceptPassenger() {
return true;
}
@@ -2357,7 +_,7 @@
@@ -2354,7 +_,7 @@
}

public boolean isVisuallyCrawling() {
Expand All @@ -259,7 +259,7 @@
}

public void setSwimming(boolean p_20283_) {
@@ -2470,7 +_,7 @@
@@ -2467,7 +_,7 @@
this.igniteForSeconds(8.0F);
}

Expand All @@ -268,7 +268,7 @@
}

public void onAboveBubbleCol(boolean p_20313_) {
@@ -2565,7 +_,7 @@
@@ -2562,7 +_,7 @@
}

protected Component getTypeName() {
Expand All @@ -277,7 +277,7 @@
}

public boolean is(Entity p_20356_) {
@@ -2620,10 +_,11 @@
@@ -2617,10 +_,11 @@
}

protected final boolean isInvulnerableToBase(DamageSource p_20122_) {
Expand All @@ -290,23 +290,23 @@
}

public boolean isInvulnerable() {
@@ -2648,6 +_,7 @@
@@ -2645,6 +_,7 @@

@Nullable
public Entity teleport(TeleportTransition p_379899_) {
+ if (!net.neoforged.neoforge.common.CommonHooks.onTravelToDimension(this, p_379899_.newLevel().dimension())) return null;
if (this.level() instanceof ServerLevel serverlevel && !this.isRemoved()) {
ServerLevel serverlevel1 = p_379899_.newLevel();
boolean flag = serverlevel1.dimension() != serverlevel.dimension();
@@ -2855,6 +_,7 @@
@@ -2852,6 +_,7 @@
return this.stringUUID;
}

+ @Deprecated // Forge: Use FluidType sensitive version
public boolean isPushedByFluid() {
return true;
}
@@ -2963,6 +_,8 @@
@@ -2960,6 +_,8 @@
EntityDimensions entitydimensions = this.dimensions;
Pose pose = this.getPose();
EntityDimensions entitydimensions1 = this.getDimensions(pose);
Expand All @@ -315,7 +315,7 @@
this.dimensions = entitydimensions1;
this.eyeHeight = entitydimensions1.eyeHeight();
this.reapplyPosition();
@@ -3268,9 +_,17 @@
@@ -3265,9 +_,17 @@
return Mth.lerp(p_352259_, this.yRotO, this.yRot);
}

Expand All @@ -334,7 +334,7 @@
} else {
AABB aabb = this.getBoundingBox().deflate(0.001);
int i = Mth.floor(aabb.minX);
@@ -3285,25 +_,36 @@
@@ -3282,25 +_,36 @@
Vec3 vec3 = Vec3.ZERO;
int k1 = 0;
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
Expand Down Expand Up @@ -378,7 +378,7 @@
}
}
}
@@ -3311,27 +_,30 @@
@@ -3308,27 +_,30 @@
}
}

Expand Down Expand Up @@ -419,7 +419,7 @@
}
}

@@ -3344,7 +_,10 @@
@@ -3341,7 +_,10 @@
return !this.level().hasChunksAt(i, k, j, l);
}

Expand All @@ -430,15 +430,15 @@
return this.fluidHeight.getDouble(p_204037_);
}

@@ -3481,6 +_,7 @@
@@ -3478,6 +_,7 @@

this.levelCallback.onMove();
}
+ if (this.isAddedToLevel() && !this.level.isClientSide && !this.isRemoved()) this.level.getChunk((int) Math.floor(p_20344_) >> 4, (int) Math.floor(p_20346_) >> 4); // Forge - ensure target chunk is loaded.
}

public void checkDespawn() {
@@ -3606,6 +_,128 @@
@@ -3603,6 +_,128 @@

public boolean mayInteract(ServerLevel p_376870_, BlockPos p_146844_) {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -420,8 +_,8 @@
@@ -430,8 +_,8 @@

public Vec3 getRedstoneDirection(BlockPos p_361470_) {
BlockState blockstate = this.level().getBlockState(p_361470_);
Expand Down
Loading

0 comments on commit ad501ae

Please sign in to comment.