Skip to content

Commit e35f037

Browse files
authored
25w34b (#4821)
* 25w34b compiles * Mixin fixes * Disable a pair of rendering related mixins * Bump version
1 parent 3bb756a commit e35f037

File tree

41 files changed

+112
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+112
-122
lines changed

fabric-client-gametest-api-v1/src/client/java/net/fabricmc/fabric/impl/client/gametest/world/TestWorldBuilderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public TestDedicatedServerContext createServer(Properties serverProperties) {
110110

111111
private Path navigateCreateWorldScreen() {
112112
Path saveDirectory = context.computeOnClient(client -> {
113-
CreateWorldScreen.show(client, client.currentScreen);
113+
CreateWorldScreen.show(client, null);
114114

115115
if (!(client.currentScreen instanceof CreateWorldScreen createWorldScreen)) {
116116
throw new AssertionError("CreateWorldScreen.show did not set the current screen");

fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/impl/attachment/sync/AttachmentSync.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void onInitialize() {
106106
ServerPlayerEntity player = handler.player;
107107
List<AttachmentChange> changes = new ArrayList<>();
108108
// sync world attachments
109-
((AttachmentTargetImpl) player.world()).fabric_computeInitialSyncChanges(player, changes::add);
109+
((AttachmentTargetImpl) player.getEntityWorld()).fabric_computeInitialSyncChanges(player, changes::add);
110110
// sync player's own persistent attachments that couldn't be synced earlier
111111
((AttachmentTargetImpl) player).fabric_computeInitialSyncChanges(player, changes::add);
112112

fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/EntityMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class EntityMixin implements AttachmentTargetImpl {
4444
private int id;
4545

4646
@Shadow
47-
public abstract World world();
47+
public abstract World getEntityWorld();
4848

4949
@Inject(
5050
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;readCustomData(Lnet/minecraft/storage/ReadView;)V"),
@@ -69,7 +69,7 @@ public AttachmentTargetInfo<?> fabric_getSyncTargetInfo() {
6969

7070
@Override
7171
public void fabric_syncChange(AttachmentType<?> type, AttachmentSyncPayloadS2C payload) {
72-
if (!this.world().isClient()) {
72+
if (!this.getEntityWorld().isClient()) {
7373
AttachmentSyncPredicate predicate = ((AttachmentTypeImpl<?>) type).syncPredicate();
7474

7575
if ((Object) this instanceof ServerPlayerEntity self && predicate.test(this, self)) {
@@ -88,11 +88,11 @@ public void fabric_syncChange(AttachmentType<?> type, AttachmentSyncPayloadS2C p
8888

8989
@Override
9090
public boolean fabric_shouldTryToSync() {
91-
return !this.world().isClient();
91+
return !this.getEntityWorld().isClient();
9292
}
9393

9494
@Override
9595
public DynamicRegistryManager fabric_getDynamicRegistryManager() {
96-
return this.world().getRegistryManager();
96+
return this.getEntityWorld().getRegistryManager();
9797
}
9898
}

fabric-data-attachment-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/attachment/client/gametest/SyncGametest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void runTest(ClientGameTestContext context) {
145145
LOGGER.info("Testing synced attachments (1/2)");
146146
context.runOnClient(client -> {
147147
ClientWorld world = Objects.requireNonNull(client.world);
148-
Entity villager = world.getEntity(state.villagerId);
148+
Entity villager = world.method_66347(state.villagerId);
149149

150150
assertHasSyncedWithAll(world.getBlockEntity(state.furnacePos));
151151
assertHasSyncedWithAll(villager);

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/EntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private Entity afterWorldChanged(Entity instance, ServerWorld sourceWorld, Serve
4040
Entity ret = original.call(instance, sourceWorld, targetWorld, teleportTarget);
4141

4242
if (ret != null) {
43-
ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD.invoker().afterChangeWorld((Entity) (Object) this, ret, (ServerWorld) this.world, (ServerWorld) ret.world());
43+
ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD.invoker().afterChangeWorld((Entity) (Object) this, ret, (ServerWorld) this.world, (ServerWorld) ret.getEntityWorld());
4444
}
4545

4646
return ret;

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void onWakeUp(CallbackInfo info) {
109109
@Dynamic("method_18405: Synthetic lambda body for Optional.map in isSleepingInBed")
110110
@Inject(method = "method_18405", at = @At("RETURN"), cancellable = true)
111111
private void onIsSleepingInBed(BlockPos sleepingPos, CallbackInfoReturnable<Boolean> info) {
112-
BlockState bedState = ((LivingEntity) (Object) this).world().getBlockState(sleepingPos);
112+
BlockState bedState = ((LivingEntity) (Object) this).getEntityWorld().getBlockState(sleepingPos);
113113
ActionResult result = EntitySleepEvents.ALLOW_BED.invoker().allowBed((LivingEntity) (Object) this, sleepingPos, bedState, info.getReturnValueZ());
114114

115115
if (result != ActionResult.PASS) {

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/PlayerManagerMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ private void afterRespawn(ServerPlayerEntity oldPlayer, boolean alive, Entity.Re
3838
ServerPlayerEntity newPlayer = cir.getReturnValue();
3939
ServerPlayerEvents.AFTER_RESPAWN.invoker().afterRespawn(oldPlayer, newPlayer, alive);
4040

41-
if (oldPlayer.world() != newPlayer.world()) {
42-
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.invoker().afterChangeWorld(newPlayer, oldPlayer.world(), newPlayer.world());
41+
if (oldPlayer.getEntityWorld() != newPlayer.getEntityWorld()) {
42+
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.invoker().afterChangeWorld(newPlayer, oldPlayer.getEntityWorld(), newPlayer.getEntityWorld());
4343
}
4444
}
4545

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/ServerPlayerEntityMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
@Mixin(ServerPlayerEntity.class)
5454
abstract class ServerPlayerEntityMixin extends LivingEntityMixin {
5555
@Shadow
56-
public abstract ServerWorld world();
56+
public abstract ServerWorld getEntityWorld();
5757

5858
/**
5959
* Minecraft by default does not call Entity#onKilledOther for a ServerPlayerEntity being killed.
@@ -66,8 +66,8 @@ private void callOnKillForPlayer(DamageSource source, CallbackInfo ci) {
6666

6767
// If the damage source that killed the player was an entity, then fire the event.
6868
if (attacker != null) {
69-
attacker.onKilledOther(this.world(), (ServerPlayerEntity) (Object) this, source);
70-
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.invoker().afterKilledOtherEntity(this.world(), attacker, (ServerPlayerEntity) (Object) this);
69+
attacker.onKilledOther(this.getEntityWorld(), (ServerPlayerEntity) (Object) this, source);
70+
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.invoker().afterKilledOtherEntity(this.getEntityWorld(), attacker, (ServerPlayerEntity) (Object) this);
7171
}
7272
}
7373

@@ -81,7 +81,7 @@ private void notifyDeath(DamageSource source, CallbackInfo ci) {
8181
*/
8282
@Inject(method = "worldChanged(Lnet/minecraft/server/world/ServerWorld;)V", at = @At("TAIL"))
8383
private void afterWorldChanged(ServerWorld origin, CallbackInfo ci) {
84-
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.invoker().afterChangeWorld((ServerPlayerEntity) (Object) this, origin, this.world());
84+
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.invoker().afterChangeWorld((ServerPlayerEntity) (Object) this, origin, this.getEntityWorld());
8585
}
8686

8787
@Inject(method = "copyFrom", at = @At("TAIL"))

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/elytra/LivingEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void injectElytraTick(CallbackInfo info) {
4747

4848
if (!EntityElytraEvents.ALLOW.invoker().allowElytraFlight(self)) {
4949
// The entity is already fall flying by now, we just need to stop it.
50-
if (!world().isClient()) {
50+
if (!getEntityWorld().isClient()) {
5151
setFlag(Entity.GLIDING_FLAG_INDEX, false);
5252
}
5353

fabric-entity-events-v1/src/testmod/java/net/fabricmc/fabric/test/entity/event/EntityEventTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void onInitialize() {
8787
});
8888

8989
ServerPlayerEvents.AFTER_RESPAWN.register((oldPlayer, newPlayer, alive) -> {
90-
LOGGER.info("Respawned {}, [{}, {}]", oldPlayer.getGameProfile().getName(), oldPlayer.world().getRegistryKey().getValue(), newPlayer.world().getRegistryKey().getValue());
90+
LOGGER.info("Respawned {}, [{}, {}]", oldPlayer.getGameProfile().getName(), oldPlayer.getEntityWorld().getRegistryKey().getValue(), newPlayer.getEntityWorld().getRegistryKey().getValue());
9191
});
9292

9393
// No fall damage if holding a feather in the main hand
@@ -144,7 +144,7 @@ public void onInitialize() {
144144

145145
EntitySleepEvents.START_SLEEPING.register((entity, sleepingPos) -> {
146146
LOGGER.info("Entity {} sleeping at {}", entity, sleepingPos);
147-
BlockState bedState = entity.world().getBlockState(sleepingPos);
147+
BlockState bedState = entity.getEntityWorld().getBlockState(sleepingPos);
148148

149149
if (bedState.isOf(TEST_BED)) {
150150
boolean shouldBeOccupied = !entity.getStackInHand(Hand.MAIN_HAND).isOf(Items.ORANGE_WOOL);
@@ -164,12 +164,12 @@ public void onInitialize() {
164164
});
165165

166166
EntitySleepEvents.MODIFY_SLEEPING_DIRECTION.register((entity, sleepingPos, sleepingDirection) -> {
167-
return entity.world().getBlockState(sleepingPos).isOf(TEST_BED) ? Direction.NORTH : sleepingDirection;
167+
return entity.getEntityWorld().getBlockState(sleepingPos).isOf(TEST_BED) ? Direction.NORTH : sleepingDirection;
168168
});
169169

170170
EntitySleepEvents.ALLOW_SLEEP_TIME.register((player, sleepingPos, vanillaResult) -> {
171171
// Yellow wool allows to sleep during the day
172-
if (player.world().isDay() && player.getStackInHand(Hand.MAIN_HAND).isOf(Items.YELLOW_WOOL)) {
172+
if (player.getEntityWorld().isDay() && player.getStackInHand(Hand.MAIN_HAND).isOf(Items.YELLOW_WOOL)) {
173173
return ActionResult.SUCCESS;
174174
}
175175

0 commit comments

Comments
 (0)