diff --git a/src/main/java/carpet/mixins/BastionFeatureMixin.java b/src/main/java/carpet/mixins/BastionFeatureMixin.java deleted file mode 100644 index 20a5273a..00000000 --- a/src/main/java/carpet/mixins/BastionFeatureMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -package carpet.mixins; - -import org.spongepowered.asm.mixin.Mixin; - -import net.minecraft.world.level.levelgen.feature.BastionFeature; - -@Mixin(BastionFeature.class) -public abstract class BastionFeatureMixin //extends JigsawFeature -{ - /* - private static final Pool spawnList = Pool.of( - new SpawnSettings.SpawnEntry(EntityType.PIGLIN_BRUTE, 5, 1, 2), - new SpawnSettings.SpawnEntry(EntityType.PIGLIN, 10, 2, 4), - new SpawnSettings.SpawnEntry(EntityType.HOGLIN, 2, 1, 2) - ); - - public BastionRemnantFeatureMixin(Codec codec, int i, boolean bl, boolean bl2) - { - super(codec, i, bl, bl2); - } - - @Override - public Pool getMonsterSpawns() - { - if (CarpetSettings.piglinsSpawningInBastions) - return spawnList; - return SpawnSettings.EMPTY_ENTRY_POOL; - } - */ -} diff --git a/src/main/java/carpet/mixins/BiomeArray_cleanLogsMixin.java b/src/main/java/carpet/mixins/BiomeArray_cleanLogsMixin.java deleted file mode 100644 index 0ff7a54c..00000000 --- a/src/main/java/carpet/mixins/BiomeArray_cleanLogsMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -//import net.minecraft.world.biome.source.BiomeArray; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -//@Mixin(BiomeArray.class) -public class BiomeArray_cleanLogsMixin -{ - // this changed in 21w18a - maybe its not needed anymore, please check - //@SuppressWarnings("UnresolvedMixinReference") - /*@Redirect(method = "(Lnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/HeightLimitView;[I)V", at = @At( - value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V") - ) - private void skipLog(Logger logger, String message, Object p0, Object p1) - { - if (!CarpetSettings.cleanLogs) logger.warn(message, p0, p1); - }*/ -} diff --git a/src/main/java/carpet/mixins/BiomeArray_getBiomeArrayMixin.java b/src/main/java/carpet/mixins/BiomeArray_getBiomeArrayMixin.java deleted file mode 100644 index 7dc2e5d3..00000000 --- a/src/main/java/carpet/mixins/BiomeArray_getBiomeArrayMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -package carpet.mixins; - -import carpet.fakes.BiomeArrayInterface; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -//@Mixin(BiomeArray.class) -public class BiomeArray_getBiomeArrayMixin //implements BiomeArrayInterface -{ -/* - @Shadow @Final private static int HORIZONTAL_SECTION_COUNT; - - @Shadow @Final public static int HORIZONTAL_BIT_MASK; - - //@Shadow @Final public static int VERTICAL_BIT_MASK; - - @Shadow @Final private Biome[] data; - - @Shadow @Final private int field_28126; - - @Shadow @Final private int field_28127; - - @Override - public void setBiomeAtIndex(BlockPos pos, World world, Biome what) - { - int int_4 = BiomeCoords.fromBlock(pos.getX()) & HORIZONTAL_BIT_MASK; - int int_5 = MathHelper.clamp(BiomeCoords.fromBlock(pos.getY())-field_28126, 0, field_28127); - int int_6 = BiomeCoords.fromBlock(pos.getZ()) & HORIZONTAL_BIT_MASK; - data[(int_5 << (HORIZONTAL_SECTION_COUNT + HORIZONTAL_SECTION_COUNT)) | (int_6 << HORIZONTAL_SECTION_COUNT) | int_4] = what; - } - - */ -} diff --git a/src/main/java/carpet/mixins/CauldronBlock_stackableSBoxesMixin.java b/src/main/java/carpet/mixins/CauldronBlock_stackableSBoxesMixin.java deleted file mode 100644 index 26b5ff7a..00000000 --- a/src/main/java/carpet/mixins/CauldronBlock_stackableSBoxesMixin.java +++ /dev/null @@ -1,25 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -import net.minecraft.world.level.block.CauldronBlock; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - -@Mixin(CauldronBlock.class) -public class CauldronBlock_stackableSBoxesMixin -{/* - @Inject(method = "onUse", locals = LocalCapture.CAPTURE_FAILHARD, at = @At( - value = "INVOKE", - target = "Lnet/minecraft/item/ItemStack;hasTag()Z", - shift = At.Shift.BEFORE - )) - private void setSboxCount(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult arg5, CallbackInfoReturnable cir, - ItemStack itemStack, int i, Item item, Block block, ItemStack itemStack5) - { - if (CarpetSettings.stackableShulkerBoxes) - itemStack5.setCount(itemStack.getCount()); - }*/ -} diff --git a/src/main/java/carpet/mixins/ClientboundTabListPacketMixin.java b/src/main/java/carpet/mixins/ClientboundTabListPacketMixin.java deleted file mode 100644 index 4a292b31..00000000 --- a/src/main/java/carpet/mixins/ClientboundTabListPacketMixin.java +++ /dev/null @@ -1,16 +0,0 @@ -package carpet.mixins; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.game.ClientboundTabListPacket; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(ClientboundTabListPacket.class) -public interface ClientboundTabListPacketMixin -{ - @Accessor("header") - void setHeader(Component header); - - @Accessor("footer") - void setFooter(Component footer); -} \ No newline at end of file diff --git a/src/main/java/carpet/mixins/DesertPyramidFeatureMixin.java b/src/main/java/carpet/mixins/DesertPyramidFeatureMixin.java deleted file mode 100644 index 1bb1a4e0..00000000 --- a/src/main/java/carpet/mixins/DesertPyramidFeatureMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -import com.google.common.collect.Lists; -import com.mojang.serialization.Codec; -import org.spongepowered.asm.mixin.Mixin; - -import java.util.Collections; -import java.util.List; -import net.minecraft.world.level.levelgen.feature.DesertPyramidFeature; - -@Mixin(DesertPyramidFeature.class) -public abstract class DesertPyramidFeatureMixin -{ - /* - private static final Pool MONSTER_SPAWNS; - - static - { - MONSTER_SPAWNS = Pool.of(new SpawnSettings.SpawnEntry(EntityType.HUSK, 1, 1, 1)); - } - - public DesertPyramidFeatureMixin(Codec codec) - { - super(codec); - } - - - @Override - public Pool getMonsterSpawns() - { - if (CarpetSettings.huskSpawningInTemples) - { - return MONSTER_SPAWNS; - } - return SpawnSettings.EMPTY_ENTRY_POOL; - } - - */ -} - diff --git a/src/main/java/carpet/mixins/EndCityFeatureMixin.java b/src/main/java/carpet/mixins/EndCityFeatureMixin.java deleted file mode 100644 index 7cebaeec..00000000 --- a/src/main/java/carpet/mixins/EndCityFeatureMixin.java +++ /dev/null @@ -1,31 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -import com.google.common.collect.Lists; -import com.mojang.serialization.Codec; -import org.spongepowered.asm.mixin.Mixin; - -import java.util.Collections; -import java.util.List; -import net.minecraft.world.level.levelgen.feature.EndCityFeature; - -@Mixin(EndCityFeature.class) -public abstract class EndCityFeatureMixin //extends StructureFeature -{ - /* - private static final Pool spawnList = Pool.of(new SpawnSettings.SpawnEntry(EntityType.SHULKER, 10, 4, 4)); - - public EndCityFeatureMixin(Codec codec) - { - super(codec); - } - - @Override - public Pool getMonsterSpawns() - { - if (CarpetSettings.shulkerSpawningInEndCities) - return spawnList; - return SpawnSettings.EMPTY_ENTRY_POOL; - } - */ -} diff --git a/src/main/java/carpet/mixins/PrimedTntMixin.java b/src/main/java/carpet/mixins/PrimedTntMixin.java index 14706051..521b1b3d 100644 --- a/src/main/java/carpet/mixins/PrimedTntMixin.java +++ b/src/main/java/carpet/mixins/PrimedTntMixin.java @@ -20,8 +20,6 @@ import net.minecraft.world.phys.Vec3; @Mixin(PrimedTnt.class) public abstract class PrimedTntMixin extends Entity implements TntEntityInterface { - //@Shadow private int fuseTimer; - @Shadow public abstract int getFuse(); private TNTLogHelper logHelper; diff --git a/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java b/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java index 1f3ac7bd..cff51789 100644 --- a/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java +++ b/src/main/java/carpet/mixins/ServerLevel_scarpetMixin.java @@ -43,30 +43,6 @@ public class ServerLevel_scarpetMixin implements ServerWorldInterface if (LIGHTNING.isNeeded()) LIGHTNING.onWorldEventFlag((ServerLevel) (Object)this, blockPos, bl2?1:0); } - /* - moved to ServerEntityManager_scarpetMixin in 1.17 - @Redirect(method = "addEntity", at = @At( - value = "INVOKE", - target = "Lnet/minecraft/server/world/ServerEntityManager;addEntity(Lnet/minecraft/world/entity/EntityLike;)Z" - )) - private boolean onEntityAddedToWorld(ServerEntityManager serverEntityManager, EntityLike entityLike) - { - Entity entity = (Entity)entityLike; - boolean success = serverEntityManager.addEntity(entity); - if (success) { - CarpetEventServer.Event event = ENTITY_LOAD.get(entity.getType()); - if (event != null) { - if (event.isNeeded()) { - event.onEntityAction(entity); - } - } else { - CarpetSettings.LOG.error("Failed to handle entity " + entity.getType().getTranslationKey()); - } - }; - return success; - } - */ - @Inject(method = "explode", at = @At("HEAD")) private void handleExplosion(/*@Nullable*/ Entity entity, /*@Nullable*/ DamageSource damageSource, /*@Nullable*/ ExplosionDamageCalculator explosionBehavior, double d, double e, double f, float g, boolean bl, Explosion.BlockInteraction destructionType, CallbackInfoReturnable cir) { diff --git a/src/main/java/carpet/mixins/ServerPlayerGameMode_antiCheatMixin.java b/src/main/java/carpet/mixins/ServerPlayerGameMode_antiCheatMixin.java index fb5dd970..0985fb47 100644 --- a/src/main/java/carpet/mixins/ServerPlayerGameMode_antiCheatMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayerGameMode_antiCheatMixin.java @@ -14,6 +14,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(value = ServerPlayerGameMode.class, priority = 69420) // not that important for carpet public class ServerPlayerGameMode_antiCheatMixin { + // this is how it should be done /* @ModifyConstant(method = "processBlockBreakingAction", require = 0, constant = @Constant(doubleValue = 36D)) diff --git a/src/main/java/carpet/mixins/SoundEngineInt_cleanLogsMixin.java b/src/main/java/carpet/mixins/SoundEngineInt_cleanLogsMixin.java deleted file mode 100644 index 4e3330e0..00000000 --- a/src/main/java/carpet/mixins/SoundEngineInt_cleanLogsMixin.java +++ /dev/null @@ -1,21 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -@Mixin(targets="com.mojang.blaze3d.audio.Library$CountingChannelPool", priority = 69420) -public class SoundEngineInt_cleanLogsMixin -{ - // createSource // method_19666, remap = false, - /*@Redirect(method = "createSource()Lnet/minecraft/client/sound/Source;", require = 0, at = @At(remap = false, - value="INVOKE", - target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V" - )) - private void doWarnOrNotWarn(Logger logger, String message, Object p0) - { - if (!CarpetSettings.cleanLogs) logger.warn(message, p0); - }*/ -} diff --git a/src/main/java/carpet/mixins/SoundEngine_cleanLogsMixin.java b/src/main/java/carpet/mixins/SoundEngine_cleanLogsMixin.java deleted file mode 100644 index ab5e5dd2..00000000 --- a/src/main/java/carpet/mixins/SoundEngine_cleanLogsMixin.java +++ /dev/null @@ -1,17 +0,0 @@ -package carpet.mixins; - -import net.minecraft.client.sounds.SoundEngine; -import org.spongepowered.asm.mixin.Mixin; - -@Mixin(value = SoundEngine.class, priority = 69420) -public class SoundEngine_cleanLogsMixin -{ - /*@Redirect(method = "play(Lnet/minecraft/client/sound/SoundInstance;)V", require = 0, at = @At( remap = false, - value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;)V" - )) - private void toWarnOrNotToWarn(Logger logger, String message) - { - if (!CarpetSettings.cleanLogs) logger.warn(message); - }*/ -} diff --git a/src/main/java/carpet/mixins/SpawnStateMixin.java b/src/main/java/carpet/mixins/SpawnState_scarpetMixin.java similarity index 53% rename from src/main/java/carpet/mixins/SpawnStateMixin.java rename to src/main/java/carpet/mixins/SpawnState_scarpetMixin.java index 44d68cf6..773e60c3 100644 --- a/src/main/java/carpet/mixins/SpawnStateMixin.java +++ b/src/main/java/carpet/mixins/SpawnState_scarpetMixin.java @@ -8,24 +8,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @Mixin(NaturalSpawner.SpawnState.class) -public class SpawnStateMixin implements SpawnHelperInnerInterface +public class SpawnState_scarpetMixin implements SpawnHelperInnerInterface { @Shadow @Final private int spawnableChunkCount; @Shadow @Final private PotentialCalculator spawnPotential; - //@Shadow @Final private Object2IntOpenHashMap groupToCount; - - /*@Inject(method = "isBelowCap", at = @At("HEAD"), cancellable = true) - private void changeMobCaps(SpawnGroup entityCategory, CallbackInfoReturnable cir) - { - int newCap = (int) ((double)entityCategory.getCapacity()*(Math.pow(2.0,(SpawnReporter.mobcap_exponent/4)))); - int i = newCap * spawningChunkCount / SpawnReporter.MAGIC_NUMBER; - cir.setReturnValue(groupToCount.getInt(entityCategory) < i); - }*/ - - - @Override public PotentialCalculator getPotentialCalculator() { diff --git a/src/main/java/carpet/mixins/StructureBlockEntity_limitsMixin.java b/src/main/java/carpet/mixins/StructureBlockEntity_limitsMixin.java index 458bf47d..ed5a5a2c 100644 --- a/src/main/java/carpet/mixins/StructureBlockEntity_limitsMixin.java +++ b/src/main/java/carpet/mixins/StructureBlockEntity_limitsMixin.java @@ -39,15 +39,4 @@ public abstract class StructureBlockEntity_limitsMixin private Block ignoredBlock(Block original) { return CarpetSettings.structureBlockIgnoredBlock; } -/* - @Environment(EnvType.CLIENT) - @ModifyConstant( - method = "getSquaredRenderDistance", - constant = @Constant(doubleValue = 96d) - ) - private double outlineRenderDistanceLimit(double original) { - return CarpetSettings.structureBlockOutlineDistance; - } - - */ } diff --git a/src/main/java/carpet/mixins/StructureFeatureMixin.java b/src/main/java/carpet/mixins/StructureFeatureMixin.java index bd2321b9..44dd1421 100644 --- a/src/main/java/carpet/mixins/StructureFeatureMixin.java +++ b/src/main/java/carpet/mixins/StructureFeatureMixin.java @@ -35,22 +35,6 @@ import net.minecraft.world.level.levelgen.structure.pieces.StructurePiecesBuilde @Mixin(StructureFeature.class) public abstract class StructureFeatureMixin implements StructureFeatureInterface { - @Shadow public abstract String getFeatureName(); - - //@Shadow public abstract StructureFeature.StructureStartFactory getStructureStartFactory(); - - //@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos chunkPos, Biome biome, ChunkPos chunkPos2, C featureConfig, HeightLimitView heightLimitView); - - //@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos pos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView); - //@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView); - - //@Shadow @Final private class_6622 field_34929; - - - //@Shadow @Final private StructurePiecesGenerator piecesGenerator; - - //@Shadow @Final private class_6834 piecesGenerator; - @Shadow @Final private PieceGeneratorSupplier pieceGenerator; @Override @@ -116,8 +100,6 @@ public abstract class StructureFeatureMixin impl private StructureStart forceStructureStart(ServerLevel worldIn, ChunkGenerator generator, Random rand, long packedChunkPos, Biome biome, C config) { ChunkPos chunkpos = new ChunkPos(packedChunkPos); - BlockPos centerpos = chunkpos.getBlockAt(9, 0, 9); - StructureStart structurestart; StructureFeature thiss= (StructureFeature)(Object)this; ChunkAccess ichunk = worldIn.getChunk(chunkpos.x, chunkpos.z, ChunkStatus.STRUCTURE_STARTS, false); @@ -131,14 +113,6 @@ public abstract class StructureFeatureMixin impl return (StructureStart) structurestartt; } } - Biome biome_1 = biome; - if (biome == null) - biome_1 = generator.getNoiseBiome(QuartPos.fromBlock(centerpos.getX()), - QuartPos.fromBlock(centerpos.getY()), QuartPos.fromBlock(centerpos.getZ())); - - - //if (config == null) - // config = (C) new DefaultFeatureConfig(); Optional> optional = pieceGenerator.createGenerator(new PieceGeneratorSupplier.Context<>(generator, generator.getBiomeSource(), worldIn.getSeed(), chunkpos, config, worldIn, b -> true, worldIn.getStructureManager(), worldIn.registryAccess())); if (optional.isEmpty()) return (StructureStart) StructureStart.INVALID_START; StructurePiecesBuilder lv = new StructurePiecesBuilder(); @@ -147,18 +121,10 @@ public abstract class StructureFeatureMixin impl }), worldIn.getSeed())); StructureStart structurestart1 = new StructureStart<>(thiss, chunkpos, 0, lv.build()); - - //StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos,0,worldIn.getSeed()); - - //structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos, config, ichunk, b -> true); - //structurestart = structurestart1.hasChildren() ? structurestart1 : (StructureStart) StructureStart.DEFAULT; - if (structurestart1.isValid()) { worldIn.getChunk(chunkpos.x, chunkpos.z).setStartForFeature(thiss, structurestart1); } - - //long2objectmap.put(packedChunkPos, structurestart); return structurestart1; } } diff --git a/src/main/resources/carpet.mixins.json b/src/main/resources/carpet.mixins.json index adcca9b3..727039c7 100644 --- a/src/main/resources/carpet.mixins.json +++ b/src/main/resources/carpet.mixins.json @@ -5,7 +5,7 @@ "compatibilityLevel": "JAVA_16", "mixins": [ "BarrierBlock_updateSuppressionBlockMixin", - "SpawnStateMixin", + "SpawnState_scarpetMixin", "MobCategory_spawnMixin", "Commands_customCommandsMixin", "ServerGamePacketListenerImplMixin", @@ -61,7 +61,6 @@ "ServerGamePacketListenerImpl_coreMixin", "ServerGamePacketListenerImpl_tickMixin", "MinecraftServer_scarpetMixin", - "ClientboundTabListPacketMixin", "ExperienceOrb_xpNoCooldownMixin", "Player_xpNoCooldownMixin", "ServerboundPlayerActionPacketMixin", @@ -96,7 +95,6 @@ "FlatLevelSource_structuresMixin", "ChunkGenerator_scarpetMixin", "Guardian_renewableSpongesMixin", - "DesertPyramidFeatureMixin", "Husk_templesMixin", "NoiseBasedChunkGenerator_husksSpawnMixin", "ServerChunkCacheMixin", @@ -114,7 +112,6 @@ "HopperBlockEntity_counterMixin", "AbstractContainerMenu_ctrlQCraftingMixin", "Connection_packetCounterMixin", - "CauldronBlock_stackableSBoxesMixin", "AbstractCauldronBlock_stackableSBoxesMixin", "Slot_stackableSBoxesMixin", "AbstractContainerMenu_stackableSBoxesMixin", @@ -129,8 +126,6 @@ "ThrowableProjectileMixin", "PathNavigation_pathfindingMixin", - "EndCityFeatureMixin", - "BastionFeatureMixin", "InfestedBlock_gravelMixin", "Player_portalDelayMixin", "PistonBaseBlock_qcMixin", @@ -211,10 +206,7 @@ "LevelRenderer_creativeNoClipMixin", "ClientPacketListener_customPacketsMixin", "DebugRenderer_scarpetRenderMixin", - "LevelRenderer_scarpetRenderMixin", - - "SoundEngineInt_cleanLogsMixin", - "SoundEngine_cleanLogsMixin" + "LevelRenderer_scarpetRenderMixin" ], "server": [ ],