From c1deda1b646c351e7990f319fd54bc9cfb33341a Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 8 Apr 2020 01:16:47 -0300 Subject: [PATCH] mappings --- gradle.properties | 4 ++-- src/main/java/carpet/helpers/FeatureGenerator.java | 8 ++++---- src/main/java/carpet/mixins/CommandManagerMixin.java | 2 +- src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java | 4 ++-- .../carpet/mixins/FloatingIslandsChunkGeneratorMixin.java | 4 ++-- src/main/java/carpet/mixins/HuskEntityMixin.java | 2 +- .../java/carpet/mixins/OverworldChunkGeneratorMixin.java | 6 +++--- .../ServerPlayNetworkHandler_antiCheatDisabledMixin.java | 6 +++--- .../java/carpet/mixins/ServerWorld_fakePlayersMixin.java | 7 +++---- src/main/java/carpet/mixins/StructureFeatureMixin.java | 2 +- src/main/java/carpet/script/value/EntityValue.java | 4 ++-- src/main/java/carpet/utils/PerimeterDiagnostics.java | 6 +++--- src/main/java/carpet/utils/SpawnReporter.java | 2 +- 13 files changed, 28 insertions(+), 29 deletions(-) diff --git a/gradle.properties b/gradle.properties index dbfefba2..e54c60c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.jvmargs=-Xmx1G # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html minecraft_version=20w14a - yarn_mappings=20w14a+build.2 - loader_version=0.7.9+build.190 + yarn_mappings=20w14a+build.11 + loader_version=0.8.2+build.194 # Mod Properties mod_version = 1.3.17+v200401 diff --git a/src/main/java/carpet/helpers/FeatureGenerator.java b/src/main/java/carpet/helpers/FeatureGenerator.java index 9c592e9f..076290a4 100644 --- a/src/main/java/carpet/helpers/FeatureGenerator.java +++ b/src/main/java/carpet/helpers/FeatureGenerator.java @@ -5,7 +5,6 @@ import carpet.fakes.StructureFeatureInterface; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import net.minecraft.block.Blocks; -import net.minecraft.class_5140; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.world.biome.Biome; @@ -21,6 +20,7 @@ import net.minecraft.world.gen.decorator.BeehiveTreeDecorator; import net.minecraft.world.gen.feature.*; import net.minecraft.world.gen.foliage.BlobFoliagePlacer; import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.trunk.StraightTrunkPlacer; import java.util.Arrays; import java.util.Collections; @@ -43,7 +43,7 @@ public class FeatureGenerator CarpetSettings.skipGenerationChecks=true; try { - return feature.generate(w, w.method_27056(), w.getChunkManager().getChunkGenerator(), w.random, p); + return feature.generate(w, w.getStructureAccessor(), w.getChunkManager().getChunkGenerator(), w.random, p); } finally { @@ -204,7 +204,7 @@ public class FeatureGenerator new SimpleBlockStateProvider(Blocks.OAK_LOG.getDefaultState()), new SimpleBlockStateProvider(Blocks.OAK_LEAVES.getDefaultState()), new BlobFoliagePlacer(2, 0, 0, 0, 3), - new class_5140(4, 2, 0)) + new StraightTrunkPlacer(4, 2, 0)) ).noVines().treeDecorators(ImmutableList.of(new BeehiveTreeDecorator(1.0F))).build() )); put("oak_large", simplePlop(Feature.FANCY_TREE.configure(DefaultBiomeFeatures.FANCY_TREE_CONFIG))); @@ -213,7 +213,7 @@ public class FeatureGenerator new SimpleBlockStateProvider(Blocks.OAK_LOG.getDefaultState()), new SimpleBlockStateProvider(Blocks.OAK_LEAVES.getDefaultState()), new BlobFoliagePlacer(0, 0, 0, 0, 0), - new class_5140(0, 0, 0)) + new StraightTrunkPlacer(0, 0, 0)) ).treeDecorators(ImmutableList.of(new BeehiveTreeDecorator(1.0F))).build() ))); put("birch", simpleTree(DefaultBiomeFeatures.BIRCH_TREE_CONFIG)); diff --git a/src/main/java/carpet/mixins/CommandManagerMixin.java b/src/main/java/carpet/mixins/CommandManagerMixin.java index 22888dde..20b5fca4 100644 --- a/src/main/java/carpet/mixins/CommandManagerMixin.java +++ b/src/main/java/carpet/mixins/CommandManagerMixin.java @@ -42,7 +42,7 @@ public abstract class CommandManagerMixin CarpetSettings.impendingFillSkipUpdates = false; } - // warning expected + @SuppressWarnings("UnresolvedMixinReference") @Redirect(method = "execute", at = @At( value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;isDebugEnabled()Z" diff --git a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java index 9718ec33..af98fd14 100644 --- a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java @@ -2,12 +2,12 @@ package carpet.mixins; import carpet.CarpetSettings; import net.minecraft.block.Blocks; -import net.minecraft.class_5138; import net.minecraft.entity.EntityCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; +import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.FlatChunkGenerator; import net.minecraft.world.gen.chunk.FlatChunkGeneratorConfig; @@ -25,7 +25,7 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator getEntitySpawnList(class_5138 arg, EntityCategory category, BlockPos pos) + public List getEntitySpawnList(StructureAccessor arg, EntityCategory category, BlockPos pos) { if (CarpetSettings.flatWorldStructureSpawning) { diff --git a/src/main/java/carpet/mixins/FloatingIslandsChunkGeneratorMixin.java b/src/main/java/carpet/mixins/FloatingIslandsChunkGeneratorMixin.java index 485542f9..045d62eb 100644 --- a/src/main/java/carpet/mixins/FloatingIslandsChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/FloatingIslandsChunkGeneratorMixin.java @@ -1,12 +1,12 @@ package carpet.mixins; import carpet.CarpetSettings; -import net.minecraft.class_5138; import net.minecraft.entity.EntityCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; +import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.chunk.FloatingIslandsChunkGenerator; import net.minecraft.world.gen.chunk.FloatingIslandsChunkGeneratorConfig; import net.minecraft.world.gen.chunk.SurfaceChunkGenerator; @@ -24,7 +24,7 @@ public abstract class FloatingIslandsChunkGeneratorMixin extends SurfaceChunkGen } @Override - public List getEntitySpawnList(class_5138 arg, EntityCategory category, BlockPos pos) + public List getEntitySpawnList(StructureAccessor arg, EntityCategory category, BlockPos pos) { if (CarpetSettings.shulkerSpawningInEndCities && EntityCategory.MONSTER == category) { diff --git a/src/main/java/carpet/mixins/HuskEntityMixin.java b/src/main/java/carpet/mixins/HuskEntityMixin.java index cbbd2be7..9e37657e 100644 --- a/src/main/java/carpet/mixins/HuskEntityMixin.java +++ b/src/main/java/carpet/mixins/HuskEntityMixin.java @@ -17,6 +17,6 @@ public class HuskEntityMixin private static boolean isSkylightOrTempleVisible(IWorld iWorld, BlockPos blockPos_1) { return iWorld.isSkyVisible(blockPos_1) || - (CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(iWorld, ((ServerWorld)iWorld).method_27056(), blockPos_1)); + (CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(iWorld, ((ServerWorld)iWorld).getStructureAccessor(), blockPos_1)); } } diff --git a/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java b/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java index 6923e0c6..709cc45e 100644 --- a/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java @@ -1,12 +1,12 @@ package carpet.mixins; import carpet.CarpetSettings; -import net.minecraft.class_5138; import net.minecraft.entity.EntityCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; +import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.chunk.OverworldChunkGenerator; import net.minecraft.world.gen.chunk.OverworldChunkGeneratorConfig; import net.minecraft.world.gen.chunk.SurfaceChunkGenerator; @@ -27,9 +27,9 @@ public abstract class OverworldChunkGeneratorMixin extends SurfaceChunkGenerator } @Inject(method = "getEntitySpawnList", at = @At(value = "INVOKE", ordinal = 1, shift = At.Shift.BEFORE, - target = "Lnet/minecraft/world/gen/feature/StructureFeature;isApproximatelyInsideStructure(Lnet/minecraft/world/IWorld;Lnet/minecraft/class_5138;Lnet/minecraft/util/math/BlockPos;)Z"), + target = "Lnet/minecraft/world/gen/feature/StructureFeature;isApproximatelyInsideStructure(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/util/math/BlockPos;)Z"), cancellable = true) - private void onGetEntitySpawnList(class_5138 arg, EntityCategory entityCategory, BlockPos blockPos, CallbackInfoReturnable> cir) + private void onGetEntitySpawnList(StructureAccessor arg, EntityCategory entityCategory, BlockPos blockPos, CallbackInfoReturnable> cir) { if (CarpetSettings.huskSpawningInTemples) { diff --git a/src/main/java/carpet/mixins/ServerPlayNetworkHandler_antiCheatDisabledMixin.java b/src/main/java/carpet/mixins/ServerPlayNetworkHandler_antiCheatDisabledMixin.java index 4bcc7019..6b93b508 100644 --- a/src/main/java/carpet/mixins/ServerPlayNetworkHandler_antiCheatDisabledMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayNetworkHandler_antiCheatDisabledMixin.java @@ -20,7 +20,7 @@ public abstract class ServerPlayNetworkHandler_antiCheatDisabledMixin @Shadow private int vehicleFloatingTicks; - @Shadow protected abstract boolean isServerOwner(); + @Shadow protected abstract boolean isHost(); @Inject(method = "tick", at = @At("HEAD")) private void restrictFloatingBits(CallbackInfo ci) @@ -35,11 +35,11 @@ public abstract class ServerPlayNetworkHandler_antiCheatDisabledMixin @Redirect(method = "onVehicleMove", at = @At( value = "INVOKE", - target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;isServerOwner()Z" + target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;isHost()Z" )) private boolean isServerTrusting(ServerPlayNetworkHandler serverPlayNetworkHandler) { - return isServerOwner() || CarpetSettings.antiCheatDisabled; + return isHost() || CarpetSettings.antiCheatDisabled; } @Redirect(method = "onPlayerMove", at = @At( diff --git a/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java b/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java index b574c8ca..352c1622 100644 --- a/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java +++ b/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java @@ -14,18 +14,17 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(ServerWorld.class) public abstract class ServerWorld_fakePlayersMixin { - @Shadow - boolean ticking; - @Shadow /*@Nonnull*/ public abstract MinecraftServer getServer(); + @Shadow private boolean inEntityTick; + @Redirect( method = "removePlayer", at = @At( value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;removeEntity(Lnet/minecraft/entity/Entity;)V" )) private void crashRemovePlayer(ServerWorld serverWorld, Entity entity_1, ServerPlayerEntity serverPlayerEntity_1) { - if ( !(ticking && serverPlayerEntity_1 instanceof EntityPlayerMPFake) ) + if ( !(inEntityTick && serverPlayerEntity_1 instanceof EntityPlayerMPFake) ) serverWorld.removeEntity(entity_1); else getServer().send(new ServerTask(getServer().getTicks(), () -> diff --git a/src/main/java/carpet/mixins/StructureFeatureMixin.java b/src/main/java/carpet/mixins/StructureFeatureMixin.java index 5e1585b9..fa8a44af 100644 --- a/src/main/java/carpet/mixins/StructureFeatureMixin.java +++ b/src/main/java/carpet/mixins/StructureFeatureMixin.java @@ -68,7 +68,7 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface BlockBox box = structurestart.getBoundingBox(); if (!wireOnly) { - structurestart.generateStructure(world, world.method_27056(), generator, rand, + structurestart.generateStructure(world, world.getStructureAccessor(), generator, rand, new BlockBox( pos.getX() - this.getRadius() * 16, pos.getZ() - this.getRadius() * 16, diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 3cd5726e..03e12f63 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -305,7 +305,7 @@ public class EntityValue extends Value ServerPlayerEntity spe = (ServerPlayerEntity) e; for (int i=4; i>=0; i--) { - if (spe.allowsPermissionLevel(i)) + if (spe.hasPermissionLevel(i)) return new NumericValue(i); } @@ -323,7 +323,7 @@ public class EntityValue extends Value if (server.isDedicated()) return new StringValue("multiplayer"); boolean runningLan = server.isRemote(); if (!runningLan) return new StringValue("singleplayer"); - boolean isowner = server.isOwner(p.getGameProfile()); + boolean isowner = server.isHost(p.getGameProfile()); if (isowner) return new StringValue("lan_host"); return new StringValue("lan player"); // realms? diff --git a/src/main/java/carpet/utils/PerimeterDiagnostics.java b/src/main/java/carpet/utils/PerimeterDiagnostics.java index d928ced0..f424df8e 100644 --- a/src/main/java/carpet/utils/PerimeterDiagnostics.java +++ b/src/main/java/carpet/utils/PerimeterDiagnostics.java @@ -155,10 +155,10 @@ public class PerimeterDiagnostics private boolean check_entity_spawn(BlockPos pos) { - if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.method_27056(), ctype, pos).contains(sle)) + if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getStructureAccessor(), ctype, pos).contains(sle)) { sle = null; - for (Biome.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.method_27056(), ctype, pos)) + for (Biome.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getStructureAccessor(), ctype, pos)) { if (el.getType() == sle.type) { @@ -166,7 +166,7 @@ public class PerimeterDiagnostics break; } } - if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.method_27056(), ctype, pos).contains(sle)) + if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getStructureAccessor(), ctype, pos).contains(sle)) { return false; } diff --git a/src/main/java/carpet/utils/SpawnReporter.java b/src/main/java/carpet/utils/SpawnReporter.java index af0ebd04..a271031c 100644 --- a/src/main/java/carpet/utils/SpawnReporter.java +++ b/src/main/java/carpet/utils/SpawnReporter.java @@ -401,7 +401,7 @@ public class SpawnReporter for (EntityCategory enumcreaturetype : EntityCategory.values()) { String type_code = String.format("%s", enumcreaturetype).substring(0, 3); - List lst = ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(worldIn.method_27056(), enumcreaturetype, pos); + List lst = ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(worldIn.getStructureAccessor(), enumcreaturetype, pos); if (lst != null && !lst.isEmpty()) { for (Biome.SpawnEntry spawnEntry : lst)