Skip to content

Commit 115a6e0

Browse files
committed
rule rename: litematicaServerPaster -> modLitematicaServerPaster, redstoneMultimeter -> modRedstoneMultimeter
so mod toggle rules have the same format now
1 parent acf3726 commit 115a6e0

15 files changed

Lines changed: 86 additions & 94 deletions

File tree

patches/net/minecraft/block/BlockDoor.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(pos.offset(state.get(HALF) == DoubleBlockHalf.LOWER ? EnumFacing.UP : EnumFacing.DOWN));
2727
-
2828
+ // RSMM start
29-
+ if (CarpetSettings.redstoneMultimeter) {
29+
+ if (CarpetSettings.modRedstoneMultimeter) {
3030
+ logPowered(worldIn, pos, flag);
3131
+ logPowered(worldIn, getOtherHalf(pos, state), flag);
3232
+ }

patches/net/minecraft/block/BlockPistonBase.java.patch

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
import net.minecraft.block.material.EnumPushReaction;
1414
import net.minecraft.block.state.BlockFaceShape;
1515
import net.minecraft.block.state.BlockPistonStructureHelper;
16-
@@ -19,6 +20,7 @@
17-
import net.minecraft.state.StateContainer;
18-
import net.minecraft.state.properties.BlockStateProperties;
19-
import net.minecraft.state.properties.PistonType;
20-
+import net.minecraft.stats.StatList;
21-
import net.minecraft.tileentity.TileEntity;
22-
import net.minecraft.tileentity.TileEntityPiston;
23-
import net.minecraft.util.EnumFacing;
24-
@@ -31,8 +33,13 @@
16+
@@ -31,8 +32,13 @@
2517
import net.minecraft.world.IBlockReader;
2618
import net.minecraft.world.World;
2719
import net.minecraft.world.WorldServer;
@@ -36,7 +28,7 @@
3628
{
3729
public static final BooleanProperty EXTENDED = BlockStateProperties.EXTENDED;
3830
protected static final VoxelShape PISTON_BASE_EAST_AABB = Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 12.0D, 16.0D, 16.0D);
39-
@@ -43,6 +50,9 @@
31+
@@ -43,6 +49,9 @@
4032
protected static final VoxelShape PISTON_BASE_DOWN_AABB = Block.makeCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 16.0D, 16.0D);
4133
private final boolean isSticky;
4234

@@ -46,7 +38,7 @@
4638
public BlockPistonBase(boolean sticky, Block.Properties properties)
4739
{
4840
super(properties);
49-
@@ -156,9 +166,17 @@
41+
@@ -156,9 +165,17 @@
5042
}
5143
}
5244

@@ -66,7 +58,7 @@
6658
{
6759
if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing))
6860
{
69-
@@ -172,9 +190,17 @@
61+
@@ -172,9 +189,17 @@
7062
}
7163
else
7264
{
@@ -85,7 +77,7 @@
8577
{
8678
if (enumfacing1 != EnumFacing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1))
8779
{
88-
@@ -186,6 +212,15 @@
80+
@@ -186,6 +211,15 @@
8981
}
9082
}
9183

@@ -101,7 +93,7 @@
10193
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
10294
{
10395
EnumFacing enumfacing = state.get(FACING);
104-
@@ -255,6 +290,9 @@
96+
@@ -255,6 +289,9 @@
10597
{
10698
if (id != 1 || iblockstate.isAir() || !canPush(iblockstate, worldIn, blockpos, enumfacing.getOpposite(), false, enumfacing) || iblockstate.getPushReaction() != EnumPushReaction.NORMAL && block != Blocks.PISTON && block != Blocks.STICKY_PISTON)
10799
{
@@ -111,7 +103,7 @@
111103
worldIn.removeBlock(pos.offset(enumfacing));
112104
}
113105
else
114-
@@ -265,12 +303,14 @@
106+
@@ -265,12 +302,14 @@
115107
}
116108
else
117109
{
@@ -127,7 +119,7 @@
127119
return true;
128120
}
129121

130-
@@ -316,8 +356,14 @@
122+
@@ -316,8 +355,14 @@
131123
{
132124
return false;
133125
}
@@ -144,7 +136,7 @@
144136
}
145137
else
146138
{
147-
@@ -329,6 +375,14 @@
139+
@@ -329,6 +374,14 @@
148140
return false;
149141
}
150142
}
@@ -159,7 +151,7 @@
159151

160152
private boolean doMove(World worldIn, BlockPos pos, EnumFacing direction, boolean extending)
161153
{
162-
@@ -371,15 +425,55 @@
154+
@@ -371,15 +424,55 @@
163155
--k;
164156
aiblockstate[k] = iblockstate;
165157
}
@@ -187,7 +179,7 @@
187179
BlockPos blockpos3 = list.get(l);
188180
IBlockState iblockstate3 = worldIn.getBlockState(blockpos3);
189181
+ // RSMM start
190-
+ if (CarpetSettings.redstoneMultimeter && !worldIn.isRemote()) {
182+
+ if (CarpetSettings.modRedstoneMultimeter && !worldIn.isRemote()) {
191183
+ Multimeter multimeter = ((WorldServer)worldIn).getMultimeter();
192184
+ multimeter.logMoved(worldIn, blockpos3, enumfacing);
193185
+ multimeter.moveMeters(worldIn, blockpos3, enumfacing);
@@ -216,7 +208,7 @@
216208
--k;
217209
aiblockstate[k] = iblockstate3;
218210
}
219-
@@ -450,4 +544,22 @@
211+
@@ -450,4 +543,22 @@
220212
{
221213
return false;
222214
}

patches/net/minecraft/block/state/IBlockState.java.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
default void randomTick(World worldIn, BlockPos pos, Random random)
2626
{
2727
+ // RSMM start
28-
+ if (CarpetSettings.redstoneMultimeter && !worldIn.isRemote()) {
28+
+ if (CarpetSettings.modRedstoneMultimeter && !worldIn.isRemote()) {
2929
+ ((WorldServer)worldIn).getMultimeter().logRandomTick(worldIn, pos);
3030
+ }
3131
+ // RSMM end
@@ -37,7 +37,7 @@
3737
default boolean onBlockActivated(World worldIn, BlockPos pos, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
3838
{
3939
+ // RSMM start
40-
+ if (CarpetSettings.redstoneMultimeter && !worldIn.isRemote()) {
40+
+ if (CarpetSettings.modRedstoneMultimeter && !worldIn.isRemote()) {
4141
+ ((WorldServer)worldIn).getMultimeter().logInteractBlock(worldIn, pos);
4242
+ }
4343
+ // RSMM end
@@ -49,7 +49,7 @@
4949
default IBlockState updatePostPlacement(EnumFacing face, IBlockState queried, IWorld worldIn, BlockPos currentPos, BlockPos offsetPos)
5050
{
5151
+ // RSMM start
52-
+ if (CarpetSettings.redstoneMultimeter && worldIn instanceof WorldServer) {
52+
+ if (CarpetSettings.modRedstoneMultimeter && worldIn instanceof WorldServer) {
5353
+ WorldServer world = (WorldServer)worldIn;
5454
+ world.getMultimeter().logShapeUpdate(world, currentPos, face);
5555
+ }

patches/net/minecraft/fluid/IFluidState.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
default void randomTick(World worldIn, BlockPos pos, Random random)
2525
{
2626
+ // RSMM start
27-
+ if (CarpetSettings.redstoneMultimeter && !worldIn.isRemote()) {
27+
+ if (CarpetSettings.modRedstoneMultimeter && !worldIn.isRemote()) {
2828
+ ((WorldServer)worldIn).getMultimeter().logRandomTick(worldIn, pos);
2929
+ }
3030
+ // RSMM end

patches/net/minecraft/tileentity/TileEntityComparator.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public void setOutputSignal(int outputSignalIn)
1515
{
1616
+ // RSMM start
17-
+ if (CarpetSettings.redstoneMultimeter && !world.isRemote()) {
17+
+ if (CarpetSettings.modRedstoneMultimeter && !world.isRemote()) {
1818
+ ((WorldServer)world).getMultimeter().logPowerChange(world, pos, outputSignal, outputSignalIn);
1919
+ }
2020
+ // RSMM end

patches/net/minecraft/tileentity/TileEntityTrappedChest.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{
2424
- super.onOpenOrClose();
2525
+ // RSMM start
26-
+ if (CarpetSettings.redstoneMultimeter && !world.isRemote()) {
26+
+ if (CarpetSettings.modRedstoneMultimeter && !world.isRemote()) {
2727
+ MultimeterServer server = ((WorldServer)world).getMultimeterServer();
2828
+ Multimeter multimeter = server.getMultimeter();
2929
+

patches/net/minecraft/world/WorldServer.java.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
if (ifluidstate.getFluid() == fluidTickEntry.getTarget())
450450
{
451451
+ // RSMM start
452-
+ if (CarpetSettings.redstoneMultimeter) {
452+
+ if (CarpetSettings.modRedstoneMultimeter) {
453453
+ getMultimeter().logScheduledTick(this, fluidTickEntry);
454454
+ }
455455
+ // RSMM end
@@ -466,7 +466,7 @@
466466
if (iblockstate.getBlock() == blockTickEntry.getTarget())
467467
{
468468
+ // RSMM start
469-
+ if (CarpetSettings.redstoneMultimeter) {
469+
+ if (CarpetSettings.modRedstoneMultimeter) {
470470
+ getMultimeter().logScheduledTick(this, blockTickEntry);
471471
+ }
472472
+ // RSMM end
@@ -505,7 +505,7 @@
505505
+ // end TISCM Micro Timing logger
506506
+
507507
+ // RSMM start
508-
+ if (CarpetSettings.redstoneMultimeter) {
508+
+ if (CarpetSettings.modRedstoneMultimeter) {
509509
+ getMultimeter().logBlockEvent(this, blockeventdata, depth);
510510
+ }
511511
+ // RSMM end
@@ -549,7 +549,7 @@
549549
+ // RSMM
550550
+ @Override
551551
+ public void onBlockUpdate(BlockPos pos, IBlockState state) {
552-
+ if (CarpetSettings.redstoneMultimeter) {
552+
+ if (CarpetSettings.modRedstoneMultimeter) {
553553
+ MultimeterServer server = getMultimeterServer();
554554
+ Multimeter multimeter = server.getMultimeter();
555555
+
@@ -564,23 +564,23 @@
564564
+ // RSMM
565565
+ @Override
566566
+ public void onComparatorUpdate(BlockPos pos) {
567-
+ if (CarpetSettings.redstoneMultimeter) {
567+
+ if (CarpetSettings.modRedstoneMultimeter) {
568568
+ getMultimeter().logComparatorUpdate(this, pos);
569569
+ }
570570
+ }
571571
+
572572
+ // RSMM
573573
+ @Override
574574
+ public void onEntityTick(Entity entity) {
575-
+ if (CarpetSettings.redstoneMultimeter) {
575+
+ if (CarpetSettings.modRedstoneMultimeter) {
576576
+ getMultimeter().logEntityTick(this, entity);
577577
+ }
578578
+ }
579579
+
580580
+ // RSMM
581581
+ @Override
582582
+ public void onBlockEntityTick(TileEntity blockEntity) {
583-
+ if (CarpetSettings.redstoneMultimeter) {
583+
+ if (CarpetSettings.modRedstoneMultimeter) {
584584
+ getMultimeter().logBlockEntityTick(this, blockEntity);
585585
+ }
586586
+ }

patches/net/minecraft/world/chunk/Chunk.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
if (!this.world.isRemote)
354354
{
355355
+ // RSMM start
356-
+ if (CarpetSettings.redstoneMultimeter) {
356+
+ if (CarpetSettings.modRedstoneMultimeter) {
357357
+ ((WorldServer)world).getMultimeter().onBlockChange(world, pos, iblockstate, state);
358358
+ }
359359
+ // RSMM end

src/main/java/carpet/settings/CarpetSettings.java

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -89,54 +89,6 @@ public Boolean validate(CommandSource source, ParsedRule<Boolean> currentRule, B
8989
)
9090
public static String commandRaycount = "false";
9191

92-
@Rule(
93-
desc = "Enables world edit operations",
94-
category = COMMAND,
95-
validate = ValidateWorldEdit.class
96-
)
97-
public static String modWorldEdit = "false";
98-
99-
private static class ValidateWorldEdit extends Validator<String>
100-
{
101-
@Override
102-
public String validate(CommandSource source, ParsedRule<String> currentRule, String newValue, String string)
103-
{
104-
if (!newValue.equals("false") && !TISCMConfig.MOD_WORLDEDIT)
105-
{
106-
return null;
107-
}
108-
return newValue;
109-
}
110-
public String description()
111-
{
112-
return "You must set `TISCMConfig.MOD_WORLDEDIT` to true during mod compiling and have worldedit classes included in .jar to enable world edit";
113-
}
114-
}
115-
116-
@Rule(
117-
desc = "Enables spark command",
118-
category = COMMAND,
119-
validate = ValidateSpark.class
120-
)
121-
public static String modSpark = "false";
122-
123-
private static class ValidateSpark extends Validator<String>
124-
{
125-
@Override
126-
public String validate(CommandSource source, ParsedRule<String> currentRule, String newValue, String string)
127-
{
128-
if (!newValue.equals("false") && !TISCMConfig.MOD_SPARK)
129-
{
130-
return null;
131-
}
132-
return newValue;
133-
}
134-
public String description()
135-
{
136-
return "You must set `TISCMConfig.MOD_SPARK` to true during mod compiling and have spark classes included in .jar to enable spark";
137-
}
138-
}
139-
14092
@Rule(
14193
desc = "enable visualize projectile logger",
14294
category = SURVIVAL
@@ -1229,7 +1181,7 @@ private static class LanguageValidator extends Validator<String>
12291181
extra = "https://github.com/Fallen-Breath/litematica-server-paster",
12301182
category = CREATIVE
12311183
)
1232-
public static boolean litematicaServerPaster = false;
1184+
public static boolean modLitematicaServerPaster = false;
12331185

12341186
// RSMM
12351187
@Rule(
@@ -1239,5 +1191,53 @@ private static class LanguageValidator extends Validator<String>
12391191
COMMAND
12401192
}
12411193
)
1242-
public static boolean redstoneMultimeter = false;
1194+
public static boolean modRedstoneMultimeter = false;
1195+
1196+
@Rule(
1197+
desc = "Enables spark command",
1198+
category = COMMAND,
1199+
validate = ValidateSpark.class
1200+
)
1201+
public static String modSpark = "false";
1202+
1203+
private static class ValidateSpark extends Validator<String>
1204+
{
1205+
@Override
1206+
public String validate(CommandSource source, ParsedRule<String> currentRule, String newValue, String string)
1207+
{
1208+
if (!newValue.equals("false") && !TISCMConfig.MOD_SPARK)
1209+
{
1210+
return null;
1211+
}
1212+
return newValue;
1213+
}
1214+
public String description()
1215+
{
1216+
return "You must set `TISCMConfig.MOD_SPARK` to true during mod compiling and have spark classes included in .jar to enable spark";
1217+
}
1218+
}
1219+
1220+
@Rule(
1221+
desc = "Enables world edit operations",
1222+
category = COMMAND,
1223+
validate = ValidateWorldEdit.class
1224+
)
1225+
public static String modWorldEdit = "false";
1226+
1227+
private static class ValidateWorldEdit extends Validator<String>
1228+
{
1229+
@Override
1230+
public String validate(CommandSource source, ParsedRule<String> currentRule, String newValue, String string)
1231+
{
1232+
if (!newValue.equals("false") && !TISCMConfig.MOD_WORLDEDIT)
1233+
{
1234+
return null;
1235+
}
1236+
return newValue;
1237+
}
1238+
public String description()
1239+
{
1240+
return "You must set `TISCMConfig.MOD_WORLDEDIT` to true during mod compiling and have worldedit classes included in .jar to enable world edit";
1241+
}
1242+
}
12431243
}

src/main/java/me/fallenbreath/lmspaster/LitematicaServerPasterAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class LitematicaServerPasterAccess
1414
{
1515
public static void onPacket(CPacketCustomPayload packetIn, EntityPlayerMP player)
1616
{
17-
if (!CarpetSettings.litematicaServerPaster)
17+
if (!CarpetSettings.modLitematicaServerPaster)
1818
{
1919
return;
2020
}

0 commit comments

Comments
 (0)