remove unused mixins

This commit is contained in:
gnembon committed 2022-01-29 22:13:13 +01:00
1 parent fc2a22ff91
commit 01367142ac
16 files changed
+4 -332

No files matched your search

@@ -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<SpawnSettings.SpawnEntry> 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<StructurePoolFeatureConfig> codec, int i, boolean bl, boolean bl2)
{
super(codec, i, bl, bl2);
}
@Override
public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.piglinsSpawningInBastions)
return spawnList;
return SpawnSettings.EMPTY_ENTRY_POOL;
}
*/
}
@@ -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 = "<init>(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);
}*/
}
@@ -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;
}
*/
}
@@ -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<Boolean> cir,
ItemStack itemStack, int i, Item item, Block block, ItemStack itemStack5)
{
if (CarpetSettings.stackableShulkerBoxes)
itemStack5.setCount(itemStack.getCount());
}*/
}
@@ -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);
}
@@ -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<SpawnSettings.SpawnEntry> MONSTER_SPAWNS;
static
{
MONSTER_SPAWNS = Pool.of(new SpawnSettings.SpawnEntry(EntityType.HUSK, 1, 1, 1));
}
public DesertPyramidFeatureMixin(Codec<DefaultFeatureConfig> codec)
{
super(codec);
}
@Override
public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.huskSpawningInTemples)
{
return MONSTER_SPAWNS;
}
return SpawnSettings.EMPTY_ENTRY_POOL;
}
*/
}
@@ -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<DefaultFeatureConfig>
{
/*
private static final Pool<SpawnSettings.SpawnEntry> spawnList = Pool.of(new SpawnSettings.SpawnEntry(EntityType.SHULKER, 10, 4, 4));
public EndCityFeatureMixin(Codec<DefaultFeatureConfig> codec)
{
super(codec);
}
@Override
public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.shulkerSpawningInEndCities)
return spawnList;
return SpawnSettings.EMPTY_ENTRY_POOL;
}
*/
}
@@ -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;
@@ -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<Explosion> cir)
{
@@ -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))
@@ -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);
}*/
}
@@ -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);
}*/
}
@@ -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<SpawnGroup> groupToCount;
/*@Inject(method = "isBelowCap", at = @At("HEAD"), cancellable = true)
private void changeMobCaps(SpawnGroup entityCategory, CallbackInfoReturnable<Boolean> 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()
{
@@ -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;
}
*/
}
@@ -35,22 +35,6 @@ import net.minecraft.world.level.levelgen.structure.pieces.StructurePiecesBuilde
@Mixin(StructureFeature.class)
public abstract class StructureFeatureMixin<C extends FeatureConfiguration> implements StructureFeatureInterface<C>
{
@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<C> field_34929;
//@Shadow @Final private StructurePiecesGenerator<C> piecesGenerator;
//@Shadow @Final private class_6834<C> piecesGenerator;
@Shadow @Final private PieceGeneratorSupplier<C> pieceGenerator;
@Override
@@ -116,8 +100,6 @@ public abstract class StructureFeatureMixin<C extends FeatureConfiguration> impl
private StructureStart<C> 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<C> structurestart;
StructureFeature<C> thiss= (StructureFeature<C>)(Object)this;
ChunkAccess ichunk = worldIn.getChunk(chunkpos.x, chunkpos.z, ChunkStatus.STRUCTURE_STARTS, false);
@@ -131,14 +113,6 @@ public abstract class StructureFeatureMixin<C extends FeatureConfiguration> impl
return (StructureStart<C>) 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<PieceGenerator<C>> 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<C>) StructureStart.INVALID_START;
StructurePiecesBuilder lv = new StructurePiecesBuilder();
@@ -147,18 +121,10 @@ public abstract class StructureFeatureMixin<C extends FeatureConfiguration> impl
}), worldIn.getSeed()));
StructureStart<C> 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<C>) StructureStart.DEFAULT;
if (structurestart1.isValid())
{
worldIn.getChunk(chunkpos.x, chunkpos.z).setStartForFeature(thiss, structurestart1);
}
//long2objectmap.put(packedChunkPos, structurestart);
return structurestart1;
}
}