diff --git a/README.md b/README.md index 7581596..fb00fae 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A small [carpet](https://github.com/gnembon/fabric-carpet) extension mod. +You can also view the project on [Modrinth](https://modrinth.com/mod/joacarpet) + ## Carpet Mod Settings ### insaneBehaviors Makes the random velocities of droppers and projectiles (as well as both the position and velocity of blocks broken by pistons) systematically iterate through the most extreme values possible, and then repeatedly iterate through all the halfway points in between, in a sense attempting every point in a 3d/5d "grid" that slowly increases in resolution. diff --git a/build.gradle b/build.gradle index ef6e57a..003e99d 100644 --- a/build.gradle +++ b/build.gradle @@ -12,17 +12,17 @@ plugins { } preprocess { - def mc114 = createNode('1.14.4' , 1_14_04, 'yarn') - def mc115 = createNode('1.15.2' , 1_15_02, 'yarn') - def mc116 = createNode('1.16.5' , 1_16_05, 'yarn') +// def mc114 = createNode('1.14.4' , 1_14_04, 'yarn') +// def mc115 = createNode('1.15.2' , 1_15_02, 'yarn') +// def mc116 = createNode('1.16.5' , 1_16_05, 'yarn') def mc117 = createNode('1.17.1' , 1_17_01, 'yarn') def mc118 = createNode('1.18.2' , 1_18_02, 'yarn') def mc119 = createNode('1.19.4' , 1_19_04, 'yarn') def mc120 = createNode('1.20.2' , 1_20_02, 'yarn') - mc115.link(mc114, null) - mc115.link(mc116, null) - mc116.link(mc117, null) +// mc115.link(mc114, null) +// mc115.link(mc116, null) +// mc116.link(mc117, null) mc117.link(mc118, null) mc118.link(mc119, null) mc119.link(mc120, null) diff --git a/settings.json b/settings.json index f0e128c..a1c21bf 100644 --- a/settings.json +++ b/settings.json @@ -1,8 +1,5 @@ { "versions": [ - "1.14.4", - "1.15.2", - "1.16.5", "1.17.1", "1.18.2", "1.19.4", diff --git a/src/main/java/com/joacarpet/HelloWorldTemplate.java b/src/main/java/com/joacarpet/HelloWorldTemplate.java index 150cf3a..c1f77af 100644 --- a/src/main/java/com/joacarpet/HelloWorldTemplate.java +++ b/src/main/java/com/joacarpet/HelloWorldTemplate.java @@ -25,20 +25,20 @@ import net.fabricmc.loader.api.metadata.ModMetadata; //#if MC >= 11800 -//$$ import com.mojang.logging.LogUtils; -//$$ import org.slf4j.Logger; +import com.mojang.logging.LogUtils; +import org.slf4j.Logger; //#else -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +//$$ import org.apache.logging.log4j.LogManager; +//$$ import org.apache.logging.log4j.Logger; //#endif public class HelloWorldTemplate implements ModInitializer { public static final Logger LOGGER = //#if MC >= 11800 - //$$ LogUtils.getLogger(); + LogUtils.getLogger(); //#else - LogManager.getLogger(); + //$$ LogManager.getLogger(); //#endif public static final String MOD_ID = "com/joacarpet"; diff --git a/src/main/java/com/joacarpet/JoaCarpetMod.java b/src/main/java/com/joacarpet/JoaCarpetMod.java index f69a29e..d3b6d6f 100644 --- a/src/main/java/com/joacarpet/JoaCarpetMod.java +++ b/src/main/java/com/joacarpet/JoaCarpetMod.java @@ -35,23 +35,23 @@ //#if MC >= 11900 -//$$ import net.minecraft.commands.CommandBuildContext; +import net.minecraft.commands.CommandBuildContext; //#endif //#if MC >= 11800 -//$$ import org.slf4j.Logger; -//$$ import org.slf4j.LoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; //#else -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +//$$ import org.apache.logging.log4j.LogManager; +//$$ import org.apache.logging.log4j.Logger; //#endif public class JoaCarpetMod implements ModInitializer, CarpetExtension { public static final Logger LOGGER = //#if MC >= 11800 -//$$ LoggerFactory.getLogger("joacarpet"); + LoggerFactory.getLogger("joacarpet"); //#else - LogManager.getLogger("joacarpet"); +//$$ LogManager.getLogger("joacarpet"); //#endif @@ -65,7 +65,7 @@ public void onInitialize() {} @Override public void registerCommands(CommandDispatcher dispatcher //#if MC >= 11900 -//$$ , final CommandBuildContext commandBuildContext + , final CommandBuildContext commandBuildContext //#endif ) { InsaneBehaviorsCommand.register(dispatcher); @@ -89,13 +89,13 @@ public Map canHasTranslations(String lang) { public static void messagePlayerIfExists(CommandSourceStack c, String message) { //#if MC >= 11900 -//$$ if(c.getPlayer() != null) { -//$$ Messenger.m(c.getPlayer(), message); -//$$ } - //#else - if(c.getEntity() instanceof ServerPlayer) { - Messenger.m((Player) c.getEntity(), message); + if(c.getPlayer() != null) { + Messenger.m(c.getPlayer(), message); } + //#else +//$$ if(c.getEntity() instanceof ServerPlayer) { +//$$ Messenger.m((Player) c.getEntity(), message); +//$$ } //#endif } } diff --git a/src/main/java/com/joacarpet/JoaCarpetSettings.java b/src/main/java/com/joacarpet/JoaCarpetSettings.java index 57364e2..8f2ef3c 100644 --- a/src/main/java/com/joacarpet/JoaCarpetSettings.java +++ b/src/main/java/com/joacarpet/JoaCarpetSettings.java @@ -21,17 +21,17 @@ package com.joacarpet; //#if MC >= 11900 -//$$ import carpet.api.settings.Rule; +import carpet.api.settings.Rule; //#else -import carpet.settings.Rule; +//$$ import carpet.settings.Rule; //#endif //#if MC >= 11900 -//$$ import static carpet.api.settings.RuleCategory.COMMAND; -//$$ import static carpet.api.settings.RuleCategory.CREATIVE; +import static carpet.api.settings.RuleCategory.COMMAND; +import static carpet.api.settings.RuleCategory.CREATIVE; //#else -import static carpet.settings.RuleCategory.COMMAND; -import static carpet.settings.RuleCategory.CREATIVE; +//$$ import static carpet.settings.RuleCategory.COMMAND; +//$$ import static carpet.settings.RuleCategory.CREATIVE; //#endif @@ -40,10 +40,10 @@ public class JoaCarpetSettings { @Rule( //#if MC >= 11900 -//$$ categories = {CREATIVE, JOA}, + categories = {CREATIVE, JOA}, //#else - category = {CREATIVE, JOA}, - desc="Makes the random velocities of droppers and projectiles (as well as both the position and velocity of blocks broken by pistons) systematically iterate through the most extreme values possible, and then repeatedly iterate through all the halfway points in between, in a sense attempting every point in a 3d/5d \"grid\" that slowly increases in resolution.\nFor droppers and projectiles, this setting determines whether the max value corresponds to the old gaussian randomness limits (\"extreme\"), or the limits of the triangular randomness introduced in 1.19 (\"sensible\"). Both settings function the same for blocks being broken by pistons.\nFor the `/insanebehaviors ` command, see `/carpet commandInsaneBehaviors`.\nDo note that insaneBehaviors works on a global iterator: any triggering event will step through an iteration from all other insaneBehaviors events, too.", +//$$ category = {CREATIVE, JOA}, +//$$ desc="Makes the random velocities of droppers and projectiles (as well as both the position and velocity of blocks broken by pistons) systematically iterate through the most extreme values possible, and then repeatedly iterate through all the halfway points in between, in a sense attempting every point in a 3d/5d \"grid\" that slowly increases in resolution.\nFor droppers and projectiles, this setting determines whether the max value corresponds to the old gaussian randomness limits (\"extreme\"), or the limits of the triangular randomness introduced in 1.19 (\"sensible\"). Both settings function the same for blocks being broken by pistons.\nFor the `/insanebehaviors ` command, see `/carpet commandInsaneBehaviors`.\nDo note that insaneBehaviors works on a global iterator: any triggering event will step through an iteration from all other insaneBehaviors events, too.", //#endif options = {"extreme", "sensible", "off"} ) @@ -51,10 +51,10 @@ public class JoaCarpetSettings { @Rule( //#if MC >= 11900 -//$$ categories = {COMMAND, CREATIVE, JOA}, + categories = {COMMAND, CREATIVE, JOA}, //#else - category = {COMMAND, CREATIVE, JOA}, - desc="The command used for the `insaneBehaviors` rule.\n\"reset\" sets the `resolution` and `counter` back to the default values. \"getstate\" and \"setstate\" are used to manually read and write the current iteration state.", +//$$ category = {COMMAND, CREATIVE, JOA}, +//$$ desc="The command used for the `insaneBehaviors` rule.\n\"reset\" sets the `resolution` and `counter` back to the default values. \"getstate\" and \"setstate\" are used to manually read and write the current iteration state.", //#endif options = {"true", "ops", "false", "0", "1", "2", "3", "4"} ) @@ -62,10 +62,10 @@ public class JoaCarpetSettings { @Rule( //#if MC >= 11900 -//$$ categories = {CREATIVE, JOA}, + categories = {CREATIVE, JOA}, //#else - category = {CREATIVE, JOA}, - desc="Lets you send manual block and/or shape updates to blocks using a feather item. Updates are sent from the block in front of the face you're clicking on. Useful if you're working with update interations off or with budded blocks.", +//$$ category = {CREATIVE, JOA}, +//$$ desc="Lets you send manual block and/or shape updates to blocks using a feather item. Updates are sent from the block in front of the face you're clicking on. Useful if you're working with update interations off or with budded blocks.", //#endif options = {"off", "blockupdates", "shapeupdates", "both"} ) diff --git a/src/main/java/com/joacarpet/commands/InsaneBehaviorsCommand.java b/src/main/java/com/joacarpet/commands/InsaneBehaviorsCommand.java index 7eca08f..3c34f46 100644 --- a/src/main/java/com/joacarpet/commands/InsaneBehaviorsCommand.java +++ b/src/main/java/com/joacarpet/commands/InsaneBehaviorsCommand.java @@ -29,9 +29,9 @@ import java.util.Objects; //#if MC >= 11900 -//$$ import carpet.utils.CommandHelper; +import carpet.utils.CommandHelper; //#else -import carpet.settings.SettingsManager; +//$$ import carpet.settings.SettingsManager; //#endif import static net.minecraft.commands.Commands.argument; @@ -43,9 +43,9 @@ public static void register(CommandDispatcher dispatcher) { literal("insanebehaviors") .requires(c -> !Objects.equals(JoaCarpetSettings.insaneBehaviors, "normal") && //#if MC >= 11900 -//$$ CommandHelper.canUseCommand(c, JoaCarpetSettings.commandInsaneBehaviors)) + CommandHelper.canUseCommand(c, JoaCarpetSettings.commandInsaneBehaviors)) //#else - SettingsManager.canUseCommand(c, JoaCarpetSettings.commandInsaneBehaviors)) +//$$ SettingsManager.canUseCommand(c, JoaCarpetSettings.commandInsaneBehaviors)) //#endif diff --git a/src/main/java/com/joacarpet/mixin/blockTickling/ItemMixin.java b/src/main/java/com/joacarpet/mixin/blockTickling/ItemMixin.java index 4c9c677..0792fb6 100644 --- a/src/main/java/com/joacarpet/mixin/blockTickling/ItemMixin.java +++ b/src/main/java/com/joacarpet/mixin/blockTickling/ItemMixin.java @@ -57,11 +57,11 @@ public void useOn(UseOnContext useOnContext, CallbackInfoReturnable= 11900 -//$$ level.neighborShapeChanged(useOnContext.getClickedFace(), neighborBlockState, clickedPos, neighborPos, 2, 512); + level.neighborShapeChanged(useOnContext.getClickedFace(), neighborBlockState, clickedPos, neighborPos, 2, 512); //#else - BlockState clickedBlockState = level.getBlockState(clickedPos); - BlockState newState = clickedBlockState.updateShape(useOnContext.getClickedFace(), neighborBlockState, level, clickedPos, neighborPos); - Block.updateOrDestroy(clickedBlockState, newState, level, clickedPos, 2, 512); +//$$ BlockState clickedBlockState = level.getBlockState(clickedPos); +//$$ BlockState newState = clickedBlockState.updateShape(useOnContext.getClickedFace(), neighborBlockState, level, clickedPos, neighborPos); +//$$ Block.updateOrDestroy(clickedBlockState, newState, level, clickedPos, 2, 512); //#endif } cir.setReturnValue(InteractionResult.SUCCESS); diff --git a/src/main/java/com/joacarpet/mixin/insaneBehaviors/PistonBaseBlockMixin.java b/src/main/java/com/joacarpet/mixin/insaneBehaviors/PistonBaseBlockMixin.java index 1e394fd..1973d29 100644 --- a/src/main/java/com/joacarpet/mixin/insaneBehaviors/PistonBaseBlockMixin.java +++ b/src/main/java/com/joacarpet/mixin/insaneBehaviors/PistonBaseBlockMixin.java @@ -60,9 +60,9 @@ private void dropResources(BlockState blockState, LevelAccessor levelAccessor, B } }); //#if MC >= 11900 -//$$ blockState.spawnAfterBreak((ServerLevel)levelAccessor, blockPos, ItemStack.EMPTY, true); + blockState.spawnAfterBreak((ServerLevel)levelAccessor, blockPos, ItemStack.EMPTY, true); //#else - blockState.spawnAfterBreak((ServerLevel)levelAccessor, blockPos, ItemStack.EMPTY); +//$$ blockState.spawnAfterBreak((ServerLevel)levelAccessor, blockPos, ItemStack.EMPTY); //#endif } } diff --git a/versions/mainProject b/versions/mainProject index 507266b..341e509 100644 --- a/versions/mainProject +++ b/versions/mainProject @@ -1 +1 @@ -1.17.1 \ No newline at end of file +1.20.2 \ No newline at end of file