settings ported to the annotation based system

This commit is contained in:
gnembon committed 2019-06-11 23:01:09 -03:00
1 parent 79495eccd0
commit 734dc95dab
84 files changed
+299 -1238

No files matched your search

@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.dispenser.BlockPlacementDispenserBehavior;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
@@ -13,7 +13,7 @@ public class BlockPlacementDispenserBehaviourMixin
@Redirect(method = "dispenseSilently", at = @At(value="INVOKE", target="Lnet/minecraft/item/ItemStack;decrement(I)V"))
private void cancleDoubleDecrement(ItemStack stack, int amount)
{
if (!CarpetSettings.b_stackableShulkerBoxes)
if (!CarpetSettings.stackableShulkerBoxes)
{
stack.decrement(amount);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.BuriedTreasureGenerator;
import net.minecraft.world.Heightmap;
import net.minecraft.world.IWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.FeatureConfig;
+1 -1
View File
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.chunk.Chunk;
import org.spongepowered.asm.mixin.Mixin;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.Block;
import net.minecraft.server.command.CloneCommand;
import net.minecraft.server.world.ServerWorld;
@@ -17,7 +17,7 @@ public abstract class CloneCommandMixin
{
@ModifyConstant(method = "execute", constant = @Constant(intValue = 32768))
private static int fillLimit(int original) {
return CarpetSettings.getInt("fillLimit");
return CarpetSettings.fillLimit;
}
@Redirect(method = "execute", at = @At(
@@ -26,6 +26,6 @@ public abstract class CloneCommandMixin
))
private static void conditionalUpdating(ServerWorld serverWorld, BlockPos blockPos_1, Block block_1)
{
if (CarpetSettings.b_fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
if (CarpetSettings.fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
}
}
@@ -1,7 +1,7 @@
package carpet.mixins;
import carpet.CarpetServer;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
@@ -30,7 +30,7 @@ public abstract class CommandManagerMixin
@Inject(method = "execute", at = @At("HEAD"))
private void onExecuteBegin(ServerCommandSource serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir)
{
if (!CarpetSettings.b_fillUpdates)
if (!CarpetSettings.fillUpdates)
CarpetSettings.impendingFillSkipUpdates = true;
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.container.Container;
import net.minecraft.container.Slot;
import net.minecraft.container.SlotActionType;
@@ -29,7 +29,7 @@ public class ContainerMixin
CallbackInfoReturnable<ItemStack> cir
)
{
if (slotActionType_1 == SlotActionType.THROW && CarpetSettings.getBool("ctrlQCraftingFix") && playerEntity_1.inventory.getCursorStack().isEmpty() && int_1 >= 0)
if (slotActionType_1 == SlotActionType.THROW && CarpetSettings.ctrlQCraftingFix && playerEntity_1.inventory.getCursorStack().isEmpty() && int_1 >= 0)
{
ItemStack itemStack_1 = ItemStack.EMPTY;
Slot slot_4 = slotList.get(int_1);
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.CoralFeatureInterface;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@@ -30,7 +30,7 @@ public abstract class CoralBlockMixin implements Fertilizable
{
public boolean isFertilizable(BlockView var1, BlockPos var2, BlockState var3, boolean var4)
{
return CarpetSettings.getBool("renewableCoral") && var3.get(CoralParentBlock.WATERLOGGED) && var1.getFluidState(var2.up()).matches(FluidTags.WATER);
return CarpetSettings.renewableCoral && var3.get(CoralParentBlock.WATERLOGGED) && var1.getFluidState(var2.up()).matches(FluidTags.WATER);
}
public boolean canGrow(World var1, Random var2, BlockPos var3, BlockState var4)
@@ -1,7 +1,5 @@
package carpet.mixins;
import carpet.CarpetSettings;
import com.mojang.bridge.game.GameVersion;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
import org.spongepowered.asm.mixin.Mixin;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.EntityInterface;
import carpet.helpers.BlockRotator;
import net.minecraft.entity.Entity;
@@ -16,7 +16,7 @@ public abstract class DirectionMixin
private static float getYaw(Entity entity, float float_1)
{
float yaw;
if (!CarpetSettings.getBool("placementRotationFix"))
if (!CarpetSettings.placementRotationFix)
{
yaw = entity.getYaw(float_1);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import com.google.common.collect.Lists;
import com.mojang.datafixers.Dynamic;
import net.minecraft.entity.EntityType;
@@ -27,7 +27,7 @@ public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatur
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.b_shulkerSpawningInEndCities)
if (CarpetSettings.shulkerSpawningInEndCities)
return spawnList;
return Collections.emptyList();
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.ExperienceOrbInterface;
import carpet.helpers.XPcombine;
import net.minecraft.entity.ExperienceOrbEntity;
@@ -31,7 +31,7 @@ public abstract class ExperienceOrbEntityMixin implements ExperienceOrbInterface
))
void checkCombineAtTick(CallbackInfo ci)
{
if (CarpetSettings.getBool("combineXPOrbs"))
if (CarpetSettings.combineXPOrbs)
{
if (getCombineDelay() > 0)
{
@@ -48,7 +48,7 @@ public abstract class ExperienceOrbEntityMixin implements ExperienceOrbInterface
@Inject(method = "onPlayerCollision", at = @At("HEAD"))
void removeDelay(PlayerEntity playerEntity_1, CallbackInfo ci)
{
if (CarpetSettings.getBool("xpNoCooldown"))
if (CarpetSettings.xpNoCooldown)
playerEntity_1.experiencePickUpDelay = 0;
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.explosion.Explosion;
import org.spongepowered.asm.mixin.Final;
@@ -23,7 +23,7 @@ public abstract class ExplosionMixin
target = "Ljava/util/List;addAll(Ljava/util/Collection;)Z"))
private void clearList(CallbackInfo ci)
{
if (CarpetSettings.getBool("explosionNoBlockDamage"))
if (CarpetSettings.explosionNoBlockDamage)
{
this.affectedBlocks.clear();
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.Block;
import net.minecraft.server.command.FillCommand;
import net.minecraft.server.world.ServerWorld;
@@ -15,8 +15,9 @@ import org.spongepowered.asm.mixin.injection.Redirect;
public abstract class FillCommandMixin
{
@ModifyConstant(method = "execute", constant = @Constant(intValue = 32768))
private static int fillLimit(int original) {
return CarpetSettings.getInt("fillLimit");
private static int fillLimit(int original)
{
return CarpetSettings.fillLimit;
}
@Redirect(method = "execute", at = @At(
@@ -25,6 +26,6 @@ public abstract class FillCommandMixin
))
private static void conditionalUpdating(ServerWorld serverWorld, BlockPos blockPos_1, Block block_1)
{
if (CarpetSettings.b_fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
if (CarpetSettings.fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
}
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.EntityCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
@@ -25,7 +25,7 @@ public abstract class FloatingIslandsChunkGeneratorMixin extends SurfaceChunkGen
@Override
public List<Biome.SpawnEntry> getEntitySpawnList(EntityCategory entityCategory_1, BlockPos blockPos_1)
{
if (CarpetSettings.b_shulkerSpawningInEndCities && EntityCategory.MONSTER == entityCategory_1)
if (CarpetSettings.shulkerSpawningInEndCities && EntityCategory.MONSTER == entityCategory_1)
{
if (Feature.END_CITY.isInsideStructure(this.world, blockPos_1))
{
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.world.Heightmap;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.feature.FossilFeature;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.processor.GravityStructureProcessor;
import net.minecraft.world.Heightmap;
import net.minecraft.world.ViewableWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.EntityData;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LightningEntity;
@@ -24,7 +24,7 @@ public abstract class GuardianEntityMixin extends HostileEntity
@Override
public void onStruckByLightning(LightningEntity lightning)
{
if (!this.world.isClient && !this.removed && CarpetSettings.getBool("renewableSponges"))
if (!this.world.isClient && !this.removed && CarpetSettings.renewableSponges)
{
ElderGuardianEntity elderGuardian = new ElderGuardianEntity(EntityType.ELDER_GUARDIAN ,this.world);
elderGuardian.setPositionAndAngles(this.x, this.y, this.z, this.yaw, this.pitch);
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.HopperBlock;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.HopperBlockEntity;
@@ -41,7 +41,7 @@ public abstract class HopperBlockEntityMixin extends LootableContainerBlockEntit
@Inject(method = "insert", at = @At("HEAD"), cancellable = true)
private void onInsert(CallbackInfoReturnable<Boolean> cir)
{
if (CarpetSettings.b_hopperCounters) {
if (CarpetSettings.hopperCounters) {
DyeColor wool_color = WoolTool.getWoolColorAtPosition(
getWorld(),
new BlockPos(getHopperX(), getHopperY(), getHopperZ()).offset(this.getCachedState().get(HopperBlock.FACING)));
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.IglooGenerator;
import net.minecraft.world.Heightmap;
import net.minecraft.world.IWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@@ -26,7 +26,7 @@ public abstract class InfestedBlockMixin extends Block
private void onOnStacksDropped(BlockState blockState_1, World world_1, BlockPos blockPos_1,
ItemStack itemStack_1, CallbackInfo ci)
{
if (CarpetSettings.getBool("silverFishDropGravel"))
if (CarpetSettings.silverFishDropGravel)
{
dropStack(world_1, blockPos_1, new ItemStack(Blocks.GRAVEL));
}
@@ -10,13 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(IntegratedServer.class)
public class IntegratedServerMixin
{
@Inject(method = "setupServer",
at = @At(
value = "INVOKE",
shift = At.Shift.AFTER,
target = "Lnet/minecraft/server/integrated/IntegratedServer;setKeyPair(Ljava/security/KeyPair;)V"
)
)
@Inject(method = "setupServer", at = @At("TAIL"))
private void onSetupServerIntegrated(CallbackInfoReturnable<Boolean> cir) {
CarpetServer.onServerLoaded((IntegratedServer) (Object) this);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.helpers.InventoryHelper;
import carpet.utils.IItemEntity;
import net.minecraft.block.ShulkerBoxBlock;
@@ -41,7 +41,7 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
@Inject(method="<init>(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)V", at = @At("RETURN"))
private void removeEmptyShulkerBoxTags(World worldIn, double x, double y, double z, ItemStack stack, CallbackInfo ci)
{
if (CarpetSettings.b_stackableShulkerBoxes
if (CarpetSettings.stackableShulkerBoxes
&& stack.getItem() instanceof BlockItem
&& ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
{
@@ -59,7 +59,7 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
)
)
private int getItemStackMaxAmount(ItemStack stack) {
if (CarpetSettings.b_stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
if (CarpetSettings.stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
return SHULKERBOX_MAX_STACK_AMOUNT;
return stack.getMaxCount();
@@ -74,7 +74,7 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
{
ItemEntity self = (ItemEntity)(Object)this;
ItemStack selfStack = self.getStack();
if (!CarpetSettings.b_stackableShulkerBoxes || !(selfStack.getItem() instanceof BlockItem) || !(((BlockItem)selfStack.getItem()).getBlock() instanceof ShulkerBoxBlock)) {
if (!CarpetSettings.stackableShulkerBoxes || !(selfStack.getItem() instanceof BlockItem) || !(((BlockItem)selfStack.getItem()).getBlock() instanceof ShulkerBoxBlock)) {
return;
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.world.gen.feature.KelpFeature;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -16,7 +16,7 @@ public class KelpFeatureMixin
{
if (bound==10)
return random.nextInt(bound);
int limit = CarpetSettings.getInt("kelpGenerationGrowLimit");
int limit = CarpetSettings.kelpGenerationGrowthLimit;
if (limit == 0)
return random.nextInt(bound);
return 25-limit+random.nextInt(Math.min(23,limit+1));
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
@@ -12,7 +12,6 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
@@ -50,8 +49,8 @@ public abstract class LivingEntity_maxCollisionsMixin extends Entity
}
int limit = list_1.size();
if (CarpetSettings.n_maxEntityCollisions > 0)
limit = Math.min(limit, CarpetSettings.n_maxEntityCollisions);
if (CarpetSettings.maxEntityCollisions > 0)
limit = Math.min(limit, CarpetSettings.maxEntityCollisions);
for(int_2 = 0; int_2 < limit; ++int_2) {
Entity entity_1 = (Entity)list_1.get(int_2);
@@ -1,7 +1,7 @@
package carpet.mixins;
import carpet.CarpetServer;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.client.MinecraftClient;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@@ -12,15 +12,7 @@ public class MinecraftDedicatedServerMixin
{
//to inject right before
// this.tickWorlds(booleanSupplier_1);
@Inject(
method = "setupServer",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/util/UserCache;setUseRemote(Z)V",
shift = At.Shift.AFTER,
ordinal = 0
)
)
@Inject(method = "setupServer", at = @At("TAIL"))
private void onSetupServer(CallbackInfoReturnable<Boolean> cir) {
//CM init - all stuff loaded from the server, just before worlds loading
CarpetServer.onServerLoaded((MinecraftDedicatedServer) (Object) this);
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.MinecraftServer_motdInterface;
import net.minecraft.server.MinecraftServer;
import org.spongepowered.asm.mixin.Mixin;
@@ -27,15 +27,15 @@ public abstract class MinecraftServer_motdMixin implements MinecraftServer_motdI
@Override
public String checkMOTD()
{
if ("_".equals(CarpetSettings.getString("customMOTD")))
if ("_".equals(CarpetSettings.customMOTD))
{
setMotd(motd);
return motd;
}
else
{
setMotd(CarpetSettings.getString("customMOTD"));
return CarpetSettings.getString("customMOTD");
setMotd(CarpetSettings.customMOTD);
return CarpetSettings.customMOTD;
}
}
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.OceanRuinGenerator;
import net.minecraft.world.Heightmap;
import net.minecraft.world.IWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.BlockEntityRenderDispatcherInterface;
import carpet.fakes.PistonBlockEntityInterface;
import net.minecraft.block.entity.BlockEntity;
@@ -22,7 +22,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
double double_3, float float_1, int int_1, CallbackInfo ci)
{
if (!((PistonBlockEntityInterface) pistonBlockEntity_1).isRenderModeSet())
((PistonBlockEntityInterface) pistonBlockEntity_1).setRenderCarriedBlockEntity(CarpetSettings.b_movableTileEntities && ((PistonBlockEntityInterface) pistonBlockEntity_1).getCarriedBlockEntity() != null);
((PistonBlockEntityInterface) pistonBlockEntity_1).setRenderCarriedBlockEntity(CarpetSettings.movableTileEntities && ((PistonBlockEntityInterface) pistonBlockEntity_1).getCarriedBlockEntity() != null);
}
@Inject(method = "method_3576", at = @At("RETURN"))
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.PistonBlockEntityInterface;
import carpet.fakes.WorldInterface;
import net.minecraft.block.Block;
@@ -77,7 +77,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"))
private boolean movableTEsetBlockState0(World world, BlockPos blockPos_1, BlockState blockAState_2, int int_1)
{
if (!CarpetSettings.b_movableTileEntities)
if (!CarpetSettings.movableTileEntities)
return world.setBlockState(blockPos_1, blockAState_2, int_1);
else
return ((WorldInterface) (world)).setBlockStateWithBlockEntity(blockPos_1, blockAState_2, this.carriedBlockEntity, int_1);
@@ -87,7 +87,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"))
private boolean movableTEsetBlockState1(World world, BlockPos blockPos_1, BlockState blockState_2, int int_1)
{
if (!CarpetSettings.b_movableTileEntities)
if (!CarpetSettings.movableTileEntities)
return world.setBlockState(blockPos_1, blockState_2, int_1);
else
{
@@ -103,7 +103,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
//Handle TNT Explosions or other ways the moving Block is broken
//Also /setblock will cause this to be called, and drop e.g. a moving chest's contents.
// This is MC-40380 (BlockEntities that aren't Inventories drop stuff when setblock is called )
if (CarpetSettings.b_movableTileEntities && this.carriedBlockEntity != null && !this.world.isClient && this.world.getBlockState(this.pos).getBlock() == Blocks.AIR)
if (CarpetSettings.movableTileEntities && this.carriedBlockEntity != null && !this.world.isClient && this.world.getBlockState(this.pos).getBlock() == Blocks.AIR)
{
BlockState blockState_2;
if (this.source)
@@ -118,7 +118,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
@Inject(method = "fromTag", at = @At(value = "TAIL"))
private void onFromTag(CompoundTag compoundTag_1, CallbackInfo ci)
{
if (CarpetSettings.b_movableTileEntities && compoundTag_1.containsKey("carriedTileEntityCM", 10))
if (CarpetSettings.movableTileEntities && compoundTag_1.containsKey("carriedTileEntityCM", 10))
{
if (this.pushedBlock.getBlock() instanceof BlockEntityProvider)
this.carriedBlockEntity = ((BlockEntityProvider) (this.pushedBlock.getBlock())).createBlockEntity(this.world);
@@ -130,7 +130,7 @@ public abstract class PistonBlockEntity_movableTEMixin extends BlockEntity imple
@Inject(method = "toTag", at = @At(value = "RETURN", shift = At.Shift.BEFORE))
private void onToTag(CompoundTag compoundTag_1, CallbackInfoReturnable<CompoundTag> cir)
{
if (CarpetSettings.b_movableTileEntities && this.carriedBlockEntity != null)
if (CarpetSettings.movableTileEntities && this.carriedBlockEntity != null)
{
//Leave name "carriedTileEntityCM" instead of "carriedBlockEntityCM" for upgrade compatibility with 1.13.2 movable TE
compoundTag_1.put("carriedTileEntityCM", this.carriedBlockEntity.toTag(new CompoundTag()));
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.PistonBlockEntityInterface;
import com.google.common.collect.Lists;
import net.minecraft.block.*;
@@ -35,7 +35,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
{
Block block_1 = blockState_1.getBlock();
//Make CommandBlocks movable, either use instanceof CommandBlock or the 3 cmd block objects,
if (CarpetSettings.b_movableTileEntities && block_1 instanceof CommandBlock)
if (CarpetSettings.movableTileEntities && block_1 instanceof CommandBlock)
{
cir.setReturnValue(true);
}
@@ -58,7 +58,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
}
else
{
return !(CarpetSettings.b_movableTileEntities && isPushableTileEntityBlock(block));
return !(CarpetSettings.movableTileEntities && isPushableTileEntityBlock(block));
}
}
@Inject(method = "move", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
@@ -69,7 +69,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
Direction direction_2, Set set_1)
{
//Get the blockEntities and remove them from the world before any magic starts to happen
if (CarpetSettings.b_movableTileEntities)
if (CarpetSettings.movableTileEntities)
{
list1_BlockEntities.set(Lists.<BlockEntity>newArrayList());
for (int i = 0; i < list_1.size(); ++i)
@@ -99,7 +99,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
{
BlockEntity blockEntityPiston = PistonExtensionBlock.createBlockEntityPiston((BlockState) list_2.get(int_3),
direction_1, boolean_1, false);
if (CarpetSettings.b_movableTileEntities)
if (CarpetSettings.movableTileEntities)
((PistonBlockEntityInterface) blockEntityPiston).setCarriedBlockEntity(list1_BlockEntities.get().get(int_3));
world_1.setBlockEntity(blockPos_4, blockEntityPiston);
}
@@ -1,9 +1,8 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.piston.PistonHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@@ -13,6 +12,6 @@ public class PistonHandler_pushLimitMixin
@ModifyConstant(method = "tryMove", constant = @Constant(intValue = 12), expect = 3)
private int pushLimit(int original)
{
return CarpetSettings.n_pushLimit;
return CarpetSettings.pushLimit;
}
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.helpers.PortalHelper;
import net.minecraft.entity.player.PlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
@@ -13,7 +13,7 @@ public abstract class PlayerEntityMixin
@ModifyConstant(method = "getMaxPortalTime",
constant = @Constant(intValue = 1))
private int addFillUpdatesInt(int original) {
if (CarpetSettings.getBool("portalCreativeDelay"))
if (CarpetSettings.portalCreativeDelay)
if (PortalHelper.player_holds_obsidian((PlayerEntity) (Object)this))
return 72000;
else
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
@@ -50,7 +50,7 @@ public abstract class PlayerEntity_parrotMixin extends LivingEntity
target = "Lnet/minecraft/entity/player/PlayerEntity;updateShoulderEntity(Lnet/minecraft/nbt/CompoundTag;)V"))
private void onTickMovement(CallbackInfo ci)
{
boolean parrots_will_drop = !CarpetSettings.getBool("persistentParrots") || this.abilities.invulnerable;
boolean parrots_will_drop = !CarpetSettings.persistentParrots || this.abilities.invulnerable;
if (!this.world.isClient && ((parrots_will_drop && this.fallDistance > 0.5F) || this.isInWater() || (parrots_will_drop && this.hasVehicle())) || this.abilities.flying)
{
this.dropShoulderEntities();
@@ -80,7 +80,7 @@ public abstract class PlayerEntity_parrotMixin extends LivingEntity
target = "Lnet/minecraft/entity/player/PlayerEntity;dropShoulderEntities()V"))
private void onDamage(DamageSource damageSource_1, float float_1, CallbackInfoReturnable<Boolean> cir)
{
if (CarpetSettings.getBool("persistentParrots") && !this.isSneaking())
if (CarpetSettings.persistentParrots && !this.isSneaking())
{
if (this.random.nextFloat() < ((float_1)/15.0) )
{
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.PortalForcerInterface;
import net.minecraft.block.BlockState;
import net.minecraft.block.PortalBlock;
@@ -22,7 +22,7 @@ public class PortalBlock_portalCachingMixin
))
private void onCreatePortal(IWorld iWorld_1, BlockPos blockPos_1, CallbackInfoReturnable<Boolean> cir)
{
if (!iWorld_1.isClient() && CarpetSettings.getBool("portalCaching"))
if (!iWorld_1.isClient() && CarpetSettings.portalCaching)
{
((PortalForcerInterface)((ServerWorld)iWorld_1).getPortalForcer()).invalidateCache();
}
@@ -34,7 +34,7 @@ public class PortalBlock_portalCachingMixin
))
private void getAirBlockState(BlockState blockState_1, Direction direction_1, BlockState blockState_2, IWorld iWorld_1, BlockPos blockPos_1, BlockPos blockPos_2, CallbackInfoReturnable<BlockState> cir)
{
if (!iWorld_1.isClient() && CarpetSettings.getBool("portalCaching"))
if (!iWorld_1.isClient() && CarpetSettings.portalCaching)
{
((PortalForcerInterface)((ServerWorld)iWorld_1).getPortalForcer()).invalidateCache();
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.PortalForcerInterface;
import net.minecraft.entity.Entity;
import net.minecraft.server.world.ChunkTicketType;
@@ -45,7 +45,7 @@ public class PortalForcer_portalCachingMixin implements PortalForcerInterface
private Object /* private TicketInfo */ getTicketInfo(Map map, Object /* ColumnPos */ key)
{
//Do the dance with ticketinfos. If vanilla has one, we gonna borrow, if vanilla is missing, we supply
if (!CarpetSettings.getBool("portalCaching"))
if (!CarpetSettings.portalCaching)
return map.get(key);
Object ticketInfo = map.get(key);
if (ticketInfo != null)
@@ -71,7 +71,7 @@ public class PortalForcer_portalCachingMixin implements PortalForcerInterface
))
private Object /* TicketInfo */ putNewTicket(Map map, Object /*ColumnPos */ key, Object /*TicketInfo */ value)
{
if (CarpetSettings.getBool("portalCaching"))
if (CarpetSettings.portalCaching)
storedTicketInfos.put((ColumnPos) key, value);
return map.put(key, value);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.PoweredRailBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
@@ -13,6 +13,6 @@ public class PoweredRailBlock_powerLimitMixin
constant = @Constant(intValue = 8))
private int powerLimit(int original)
{
return CarpetSettings.railPowerLimitAdjusted;
return CarpetSettings.railPowerLimit-1;
}
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.helpers.BlockSaplingHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@@ -23,7 +23,7 @@ public abstract class SaplingBlockMixin
cancellable = true)
private void onGenerate(IWorld iWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci)
{
if(CarpetSettings.getBool("desertShrubs") && iWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(iWorld_1, blockPos_1))
if(CarpetSettings.desertShrubs && iWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(iWorld_1, blockPos_1))
{
iWorld_1.setBlockState(blockPos_1, Blocks.DEAD_BUSH.getDefaultState(), 3);
ci.cancel();
@@ -1,19 +1,17 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.helpers.TickSpeed;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.packet.PlayerInputC2SPacket;
import net.minecraft.server.network.packet.PlayerMoveC2SPacket;
import net.minecraft.server.network.packet.VehicleMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(ServerPlayNetworkHandler.class)
public class ServerPlayNetworkHandlerMixin
@@ -51,7 +49,7 @@ public class ServerPlayNetworkHandlerMixin
target = "Lnet/minecraft/server/network/ServerPlayerEntity;isInTeleportationState()Z"))
private boolean relaxMoveRestrictions(ServerPlayerEntity serverPlayerEntity)
{
return serverPlayerEntity.isInTeleportationState() || CarpetSettings.getBool("antiCheatSpeed");
return serverPlayerEntity.isInTeleportationState() || CarpetSettings.antiCheatSpeed;
}
}
@@ -1,7 +1,6 @@
package carpet.mixins;
import carpet.CarpetServer;
import carpet.CarpetSettings;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.packet.ClientCommandC2SPacket;
@@ -1,7 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.entity.player.PlayerEntity;
import carpet.settings.CarpetSettings;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Final;
@@ -26,7 +25,7 @@ public class ServerWorld_onePlayerSleepingMixin
@Inject(method = "updatePlayersSleeping", cancellable = true, at = @At("HEAD"))
private void updateOnePlayerSleeping(CallbackInfo ci)
{
if(CarpetSettings.getBool("onePlayerSleeping"))
if(CarpetSettings.onePlayerSleeping)
{
allPlayersSleeping = false;
for (ServerPlayerEntity p : players)
@@ -46,7 +45,7 @@ public class ServerWorld_onePlayerSleepingMixin
))
private boolean noneMatchSleep(Stream<ServerPlayerEntity> stream, Predicate<ServerPlayerEntity> predicate)
{
if (CarpetSettings.getBool("onePlayerSleeping"))
if (CarpetSettings.onePlayerSleeping)
return stream.anyMatch((p) -> !p.isSpectator() && p.isSleepingLongEnough());
return stream.noneMatch(predicate);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.Block;
import net.minecraft.server.command.SetBlockCommand;
import net.minecraft.server.world.ServerWorld;
@@ -18,6 +18,6 @@ public class SetBlockCommandMixin
))
private static void conditionalUpdating(ServerWorld serverWorld, BlockPos blockPos_1, Block block_1)
{
if (CarpetSettings.b_fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
if (CarpetSettings.fillUpdates) serverWorld.updateNeighbors(blockPos_1, block_1);
}
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.ShipwreckGenerator;
import net.minecraft.world.Heightmap;
import net.minecraft.world.IWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.WorldInterface;
import carpet.utils.SpawnReporter;
import net.minecraft.block.Block;
@@ -35,7 +35,7 @@ public class SpawnHelperMixin
// various configurations, but solid and 'passable' blocks, like air, water grass, etc.
// checking if in the BB of the entity are only passable blocks is very cheap and covers most cases
// in case something more complex happens - we default to full block collision check
if (CarpetSettings.b_lagFreeSpawning)
if (CarpetSettings.lagFreeSpawning)
{
BlockPos.Mutable blockpos = new BlockPos.Mutable();
for (int y = (int)bb.minY, maxy = (int)Math.ceil(bb.maxY); y < maxy; y++)
@@ -61,7 +61,7 @@ public class SpawnHelperMixin
))
private static Entity create(EntityType<?> entityType, World world_1)
{
if (CarpetSettings.b_lagFreeSpawning)
if (CarpetSettings.lagFreeSpawning)
{
Map<EntityType, Entity> precookedMobs = ((WorldInterface)world_1).getPrecookedMobs();
if (precookedMobs.containsKey(entityType))
@@ -80,7 +80,7 @@ public class SpawnHelperMixin
))
private static boolean spawnEntity(World world, Entity entity_1)
{
if (CarpetSettings.b_lagFreeSpawning)
if (CarpetSettings.lagFreeSpawning)
// we used the mob - next time we will create a new one when needed
((WorldInterface) world).getPrecookedMobs().remove(entity_1.getType());
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.entity.StructureBlockBlockEntity;
import net.minecraft.structure.Structure;
import net.minecraft.structure.StructurePlacementData;
@@ -19,7 +19,7 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin
))
private void onStructurePlacen(Structure structure, IWorld iWorld_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1)
{
if(!CarpetSettings.b_fillUpdates)
if(!CarpetSettings.fillUpdates)
CarpetSettings.impendingFillSkipUpdates = true;
try
{
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.StructureFeatureInterface;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.structure.StructureStart;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.structure.StructurePiece;
import net.minecraft.world.Heightmap;
import net.minecraft.world.ViewableWorld;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.Block;
import net.minecraft.structure.Structure;
import net.minecraft.util.math.BlockPos;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LightningEntity;
import net.minecraft.entity.mob.SkeletonHorseEntity;
@@ -31,7 +31,7 @@ public class SummonCommandMixin
private static void addRiders(ServerCommandSource source, Identifier identifier_1, Vec3d vec3d_1, CompoundTag compoundTag_1, boolean arg4, CallbackInfoReturnable<Integer> cir, CompoundTag compoundTag_2, LightningEntity lightningEntity_1)
{
// [CM] SummonNaturalLightning - if statement around
if (CarpetSettings.getBool("summonNaturalLightning") && !source.getWorld().isClient)
if (CarpetSettings.summonNaturalLightning && !source.getWorld().isClient)
{
ServerWorld world = source.getWorld();
BlockPos at = new BlockPos(vec3d_1);
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.TntBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -16,6 +16,6 @@ public abstract class TntBlockMixin
target = "Lnet/minecraft/world/World;isReceivingRedstonePower(Lnet/minecraft/util/math/BlockPos;)Z"))
private boolean isTNTDoNotUpdate(World world, BlockPos blockPos)
{
return !CarpetSettings.getBool("TNTDoNotUpdate") && world.isReceivingRedstonePower(blockPos);
return !CarpetSettings.TNTDoNotUpdate && world.isReceivingRedstonePower(blockPos);
}
}
@@ -1,11 +1,10 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.TntEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
@@ -49,7 +48,7 @@ public abstract class TntEntityMixin extends Entity
private void initTNTLogger(World world_1, double double_1, double double_2, double double_3,
LivingEntity livingEntity_1, CallbackInfo ci)
{
if(CarpetSettings.getBool("tntPrimerMomentumRemoved"))
if(CarpetSettings.tntPrimerMomentumRemoved)
this.setVelocity(new Vec3d(0.0, 0.20000000298023224D, 0.0));
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import carpet.fakes.WorldChunkInterface;
import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
@@ -48,7 +48,7 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
private BlockEntity ifGetBlockEntity(WorldChunk worldChunk, BlockPos blockPos_1,
WorldChunk.CreationType worldChunk$CreationType_1)
{
if (!CarpetSettings.b_movableTileEntities)
if (!CarpetSettings.movableTileEntities)
{
return this.getBlockEntity(blockPos_1, WorldChunk.CreationType.CHECK);
}
@@ -1,6 +1,6 @@
package carpet.mixins;
import carpet.CarpetSettings;
import carpet.settings.CarpetSettings;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;