Skip to content

Commit

Permalink
Update mainProject version
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimThorsen committed Dec 26, 2023
1 parent 3a78fe0 commit 3f74aa3
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 55 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"versions": [
"1.14.4",
"1.15.2",
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.4",
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/joacarpet/HelloWorldTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/com/joacarpet/JoaCarpetMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -65,7 +65,7 @@ public void onInitialize() {}
@Override
public void registerCommands(CommandDispatcher<CommandSourceStack> dispatcher
//#if MC >= 11900
//$$ , final CommandBuildContext commandBuildContext
, final CommandBuildContext commandBuildContext
//#endif
) {
InsaneBehaviorsCommand.register(dispatcher);
Expand All @@ -89,13 +89,13 @@ public Map<String, String> 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
}
}
30 changes: 15 additions & 15 deletions src/main/java/com/joacarpet/JoaCarpetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -40,32 +40,32 @@ 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 <reset/getstate/setstate>` 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 <reset/getstate/setstate>` 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"}
)
public static String insaneBehaviors = "off";

@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"}
)
public static String commandInsaneBehaviors = "ops";

@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"}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -43,9 +43,9 @@ public static void register(CommandDispatcher<CommandSourceStack> 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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public void useOn(UseOnContext useOnContext, CallbackInfoReturnable<InteractionR
}
if (JoaCarpetSettings.blockTickling.equals("shapeupdates") || JoaCarpetSettings.blockTickling.equals("both")) {
//#if MC >= 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion versions/mainProject
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.1
1.20.2

0 comments on commit 3f74aa3

Please sign in to comment.