Skip to content

Commit

Permalink
port to 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jun 10, 2024
1 parent d0dd0b4 commit 5456fb7
Show file tree
Hide file tree
Showing 36 changed files with 326 additions and 349 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
distribution: 'zulu'
java-version: 21
- name: Cache
uses: actions/cache@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 20
distribution: 'zulu'
java-version: 21
- name: Cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Change
- update NeoForge & MaFgLib version
- port to 1.20.6
20 changes: 11 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "dev.architectury.loom" version "1.5-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT"
id "maven-publish"
id "com.hypherionmc.modutils.modpublisher" version "2.+"
}
Expand All @@ -16,31 +16,33 @@ repositories {

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
mappings loom.layered {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
mappings "dev.architectury:yarn-mappings-patch-${loom.platform.get().id()}:${project.yarn_patch}"
}
neoForge "net.neoforged:neoforge:${project.neoforge_version}"

modImplementation "maven.modrinth:mafglib:${project.malilib_version}"
modLocalRuntime("com.github.ThinkingStudios:ForgedNetworkingAPI:0.1.0-mc1.20.4")

implementation "com.google.code.findbugs:jsr305:3.0.2"
}

processResources {
inputs.property "version", project.version

filesMatching("META-INF/mods.toml") {
filesMatching("META-INF/neoforge.mods.toml") {
expand "version": project.version
}
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
options.release = 21
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

withSourcesJar()
}
Expand Down Expand Up @@ -85,11 +87,11 @@ publisher {

setCurseID("${project.curseforge_id}")
setModrinthID("${project.modrinth_id}")
setVersionType("release")
setVersionType("alpha")
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
setVersion("${project.version}")
setDisplayName("${project.version}")
setGameVersions("1.20.3", "1.20.4")
setGameVersions("1.20.5", "1.20.6")
setLoaders("neoforge")
setCurseEnvironment("client")
setArtifact(remapJar)
Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ org.gradle.jvmargs=-Xmx1G
loom.platform=neoforge

# Base properties
minecraft_version=1.20.4
neoforge_version=20.4.235
yarn_mappings=1.20.4+build.3
minecraft_version=1.20.6
neoforge_version=20.6.113-beta
yarn_mappings=1.20.6+build.3
yarn_patch=1.20.5+build.3

# Mod Properties
mod_version=0.1.2
Expand All @@ -18,4 +19,4 @@ loom.platform=neoforge
curseforge_id=915857

# Dependencies
malilib_version=0.1.7-mc1.20.4
malilib_version=0.1.8-mc1.20.6
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 5 additions & 1 deletion src/main/java/fi/dy/masa/tweakeroo/InitHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import fi.dy.masa.malilib.event.WorldLoadHandler;
import fi.dy.masa.malilib.interfaces.IInitializationHandler;
import fi.dy.masa.malilib.interfaces.IRenderer;
import fi.dy.masa.malilib.interfaces.IWorldLoadListener;
import fi.dy.masa.tweakeroo.config.Callbacks;
import fi.dy.masa.tweakeroo.config.Configs;
import fi.dy.masa.tweakeroo.event.ClientTickHandler;
Expand All @@ -32,7 +33,10 @@ public void registerModHandlers()
RenderEventHandler.getInstance().registerWorldLastRenderer(renderer);

TickHandler.getInstance().registerClientTickHandler(new ClientTickHandler());
WorldLoadHandler.getInstance().registerWorldLoadPreHandler(new WorldLoadListener());

IWorldLoadListener worldListener = new WorldLoadListener();
WorldLoadHandler.getInstance().registerWorldLoadPreHandler(worldListener);
WorldLoadHandler.getInstance().registerWorldLoadPostHandler(worldListener);

Callbacks.init(MinecraftClient.getInstance());
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/fi/dy/masa/tweakeroo/Tweakeroo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import fi.dy.masa.malilib.event.InitializationHandler;

public class Tweakeroo {
public class Tweakeroo
{
public static final Logger logger = LogManager.getLogger(Reference.MOD_ID);

public static int renderCountItems;
public static int renderCountXPOrbs;

public static void onInitialize()
{
InitializationHandler.getInstance().registerInitializationHandler(new InitHandler());
}
}
14 changes: 9 additions & 5 deletions src/main/java/fi/dy/masa/tweakeroo/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class Generic
{
public static final ConfigInteger AFTER_CLICKER_CLICK_COUNT = new ConfigInteger ("afterClickerClickCount", 1, 1, 32, "The number of right clicks to do per placed block when\ntweakAfterClicker is enabled");
public static final ConfigDouble ANGEL_BLOCK_PLACEMENT_DISTANCE = new ConfigDouble ("angelBlockPlacementDistance", 3, 1, 5, "The distance from the player blocks can be placed in\nthe air when tweakAngelBlock is enabled.\n5 is the maximum the server allows.");
public static final ConfigDouble BLOCK_REACH_DISTANCE = new ConfigDouble ("blockReachDistance", 4.5, 0, 8, "The block reach distance to use if the\noverride tweak is enabled.\nThe maximum the server allows is 8 for placing, 6 for breaking.");
public static final ConfigDouble BLOCK_REACH_DISTANCE = new ConfigDouble ("blockReachDistance", 4.5, 1, 64, "The block reach distance to use if the override tweak is enabled.\nThe maximum the game allows is 64.\n§6Do not attempt to use this at a value beyond\n[0.5 - 1.0] higher than the Game Rules defined on a server.");
public static final ConfigOptionList BLOCK_TYPE_BREAK_RESTRICTION_WARN = new ConfigOptionList ("blockTypeBreakRestrictionWarn", MessageOutputType.MESSAGE, "Selects which type of warning message to show (if any)\nwhen the Block Type Break Restriction feature prevents breaking a block");
public static final ConfigInteger BREAKING_GRID_SIZE = new ConfigInteger ("breakingGridSize", 3, 1, 1000, "The grid interval size for the grid breaking mode.\nTo quickly adjust the value, scroll while\nholding down the tweak toggle keybind.");
public static final ConfigOptionList BREAKING_RESTRICTION_MODE = new ConfigOptionList ("breakingRestrictionMode", PlacementRestrictionMode.LINE, "The Breaking Restriction mode to use (hotkey-selectable)");
Expand All @@ -47,7 +47,9 @@ public static class Generic
public static final ConfigBoolean CARPET_ACCURATE_PLACEMENT_PROTOCOL = new ConfigBoolean ("carpetAccuratePlacementProtocol", true, "If enabled, then the Flexible Block Placement and the\nAccurate Block Placement use the protocol implemented in Carpet mod.\n§6Note: This is required for any block rotations to work, other than\n§6blocks that only care about the block side you click on (Hoppers, Logs etc.)");
public static final ConfigBoolean CLIENT_PLACEMENT_ROTATION = new ConfigBoolean ("clientPlacementRotation", true, "Enable single player and client side placement rotations,\nsuch as Accurate Placement working in single player without Carpet mod");
public static final ConfigInteger CUSTOM_INVENTORY_GUI_SCALE = new ConfigInteger ("customInventoryGuiScale", 2, 1, 10, "The GUI scale value to use for inventory screens, if\n§etweakCustomInventoryScreenScale§r is enabled.");
//public static final ConfigBoolean DEBUG_LOGGING = new ConfigBoolean ("debugLogging", false, "Enables some debug log messages in the game console,\nfor debugging certain issues or crashes.");
public static final ConfigOptionList ELYTRA_CAMERA_INDICATOR = new ConfigOptionList ("elytraCameraIndicator", ActiveMode.WITH_KEY, "Whether or not to render the real pitch angle\nindicator when the elytra camera mode is active");
public static final ConfigDouble ENTITY_REACH_DISTANCE = new ConfigDouble ("entityReachDistance", 3.0, 1, 64, "The entity reach distance to use if the override tweak is enabled.\nThe maximum the game allows is 64.\n§6Do not attempt to use this at a value beyond\n[0.5 - 1.0] higher than the Game Rules defined on a server.");
public static final ConfigOptionList ENTITY_TYPE_ATTACK_RESTRICTION_WARN = new ConfigOptionList ("entityTypeAttackRestrictionWarn", MessageOutputType.MESSAGE, "Selects which type of warning message to show (if any)\nwhen the Entity Type Attack Restriction feature prevents attacking an entity");
public static final ConfigInteger FAST_BLOCK_PLACEMENT_COUNT = new ConfigInteger ("fastBlockPlacementCount", 2, 1, 16, "The maximum number of blocks to place per game tick\nwith the Fast Block Placement tweak");
public static final ConfigBoolean FAST_LEFT_CLICK_ALLOW_TOOLS = new ConfigBoolean ("fastLeftClickAllowTools", false, "Allow the Fast Left Click to work in survival\nalso while holding tool items");
Expand Down Expand Up @@ -115,6 +117,7 @@ public static class Generic
public static final ImmutableList<IConfigBase> OPTIONS = ImmutableList.of(
CARPET_ACCURATE_PLACEMENT_PROTOCOL,
CLIENT_PLACEMENT_ROTATION,
//DEBUG_LOGGING,
FAST_LEFT_CLICK_ALLOW_TOOLS,
FAST_PLACEMENT_REMEMBER_ALWAYS,
FREE_CAMERA_PLAYER_INPUTS,
Expand Down Expand Up @@ -154,6 +157,7 @@ public static class Generic
ANGEL_BLOCK_PLACEMENT_DISTANCE,
BREAKING_GRID_SIZE,
CUSTOM_INVENTORY_GUI_SCALE,
ENTITY_REACH_DISTANCE,
FAST_BLOCK_PLACEMENT_COUNT,
FAST_LEFT_CLICK_COUNT,
FAST_RIGHT_CLICK_COUNT,
Expand Down Expand Up @@ -212,7 +216,7 @@ public static class Lists
public static final ConfigOptionList BLOCK_TYPE_BREAK_RESTRICTION_LIST_TYPE = new ConfigOptionList("blockTypeBreakRestrictionListType", ListType.BLACKLIST, "The restriction list type for the Block Type Break Restriction tweak");
public static final ConfigStringList BLOCK_TYPE_BREAK_RESTRICTION_BLACKLIST = new ConfigStringList("blockTypeBreakRestrictionBlackList", ImmutableList.of("minecraft:budding_amethyst"), "The blocks that are NOT allowed to be broken while the Block Break Restriction tweak is enabled,\nif the blockBreakRestrictionListType is set to Black List");
public static final ConfigStringList BLOCK_TYPE_BREAK_RESTRICTION_WHITELIST = new ConfigStringList("blockTypeBreakRestrictionWhiteList", ImmutableList.of(), "The only blocks that can be broken while the Block Break Restriction tweak is enabled,\nif the blockBreakRestrictionListType is set to White List");
public static final ConfigStringList CREATIVE_EXTRA_ITEMS = new ConfigStringList("creativeExtraItems", ImmutableList.of("minecraft:command_block", "minecraft:chain_command_block", "minecraft:repeating_command_block", "minecraft:dragon_egg", "minecraft:structure_void", "minecraft:structure_block", "minecraft:structure_block{BlockEntityTag:{mode:\"SAVE\"}}", "minecraft:structure_block{BlockEntityTag:{mode:\"LOAD\"}}", "minecraft:structure_block{BlockEntityTag:{mode:\"CORNER\"}}"), "Extra items that should be appended to the creative inventory.\nCurrently these will appear in the Transportation category.\nIn the future the group per added item will be customizable.");
//public static final ConfigStringList CREATIVE_EXTRA_ITEMS = new ConfigStringList("creativeExtraItems", ImmutableList.of("minecraft:command_block", "minecraft:chain_command_block", "minecraft:repeating_command_block", "minecraft:dragon_egg", "minecraft:structure_void", "minecraft:structure_block", "minecraft:structure_block{BlockEntityTag:{mode:\"SAVE\"}}", "minecraft:structure_block{BlockEntityTag:{mode:\"LOAD\"}}", "minecraft:structure_block{BlockEntityTag:{mode:\"CORNER\"}}"), "Extra items that should be appended to the creative inventory.\nCurrently these will appear in the Transportation category.\nIn the future the group per added item will be customizable.");
public static final ConfigOptionList ENTITY_TYPE_ATTACK_RESTRICTION_LIST_TYPE = new ConfigOptionList("entityTypeAttackRestrictionListType", ListType.BLACKLIST, "The restriction list type for the Entity Type Attack Restriction tweak");
public static final ConfigStringList ENTITY_TYPE_ATTACK_RESTRICTION_BLACKLIST = new ConfigStringList("entityTypeAttackRestrictionBlackList", ImmutableList.of("minecraft:villager"), "The entities that are NOT allowed to be attacked while the Entity Attack Restriction tweak is enabled,\nif the entityAttackRestrictionListType is set to Black List");
public static final ConfigStringList ENTITY_TYPE_ATTACK_RESTRICTION_WHITELIST = new ConfigStringList("entityTypeAttackRestrictionWhiteList", ImmutableList.of(), "The only entities that can be attacked while the Entity Attack Restriction tweak is enabled,\nif the entityAttackRestrictionListType is set to White List");
Expand Down Expand Up @@ -240,7 +244,7 @@ public static class Lists
BLOCK_TYPE_BREAK_RESTRICTION_LIST_TYPE,
BLOCK_TYPE_BREAK_RESTRICTION_BLACKLIST,
BLOCK_TYPE_BREAK_RESTRICTION_WHITELIST,
CREATIVE_EXTRA_ITEMS,
//CREATIVE_EXTRA_ITEMS,
ENTITY_TYPE_ATTACK_RESTRICTION_LIST_TYPE,
ENTITY_TYPE_ATTACK_RESTRICTION_BLACKLIST,
ENTITY_TYPE_ATTACK_RESTRICTION_WHITELIST,
Expand Down Expand Up @@ -276,7 +280,7 @@ public static class Disable
public static final ConfigBooleanHotkeyed DISABLE_DOUBLE_TAP_SPRINT = new ConfigBooleanHotkeyed("disableDoubleTapSprint", false, "", "Disables the double-tap-forward-key sprinting");
public static final ConfigBooleanHotkeyed DISABLE_BOSS_BAR = new ConfigBooleanHotkeyed("disableBossBar", false, "", "Disables boss bar rendering");
public static final ConfigBooleanHotkeyed DISABLE_BOSS_FOG = new ConfigBooleanHotkeyed("disableBossFog", false, "", "Removes the fog that boss mobs cause");
public static final ConfigBooleanHotkeyed DISABLE_CHUNK_RENDERING = new ConfigBooleanHotkeyed("disableChunkRendering", false, "", "Disables chunk (re-)rendering. This will make any block changes non-visible\\nuntil this is disabled again and F3 + A is used to refresh the world rendering.\\nThis might help with low fps in places with lots of block changes in some situations,\\nwhere the block changes are not really relevant at that time.");
public static final ConfigBooleanHotkeyed DISABLE_CHUNK_RENDERING = new ConfigBooleanHotkeyed("disableChunkRendering", false, "", "Disables chunk (re-)rendering. This will make any block changes non-visible\nuntil this is disabled again and F3 + A is used to refresh the world rendering.\nThis might help with low fps in places with lots of block changes in some situations,\nwhere the block changes are not really relevant at that time.");
public static final ConfigBooleanHotkeyed DISABLE_CLIENT_ENTITY_UPDATES = new ConfigBooleanHotkeyed("disableClientEntityUpdates", false, "", "Disables ALL except player entity updates on the client.\nThis is mainly meant for situations where you need to be\nable to do stuff to fix excessive entity count related problems");
public static final ConfigBooleanHotkeyed DISABLE_CLIENT_LIGHT_UPDATES = new ConfigBooleanHotkeyed("disableClientLightUpdates", false, "", "Disables all client-side light updates");
public static final ConfigBooleanHotkeyed DISABLE_CONSTANT_CHUNK_SAVING = new ConfigBooleanHotkeyed("disableConstantChunkSaving", false, "", "Disables the game saving up to 20 chunks every tick\nall the time, in addition to the normal auto-save cycle.");
Expand Down Expand Up @@ -311,7 +315,7 @@ public static class Disable
public static final ConfigBooleanHotkeyed DISABLE_TILE_ENTITY_TICKING = new ConfigBooleanClient ("disableTileEntityTicking", false, "", "Prevent all TileEntities from getting ticked");
public static final ConfigBooleanHotkeyed DISABLE_VILLAGER_TRADE_LOCKING = new ConfigBooleanClient ("disableVillagerTradeLocking", false, "", "Prevents villager trades from ever locking, by always incrementing\nthe max uses as well when the recipe uses is incremented");
public static final ConfigBooleanHotkeyed DISABLE_WALL_UNSPRINT = new ConfigBooleanHotkeyed("disableWallUnsprint", false, "", "Touching a wall doesn't drop you out from sprint mode");
public static final ConfigBooleanHotkeyed DISABLE_WORLD_VIEW_BOB = new ConfigBooleanHotkeyed("disableWorldViewBob", false, "", "Disables the view bob wobble effect of the world, but not the hand");
public static final ConfigBooleanHotkeyed DISABLE_WORLD_VIEW_BOB = new ConfigBooleanHotkeyed("disableWorldViewBob", false, "", "Disables the view bob wobble effect of the world, but not the hand\nThis setting will fail if you have Iris installed.");

public static final ImmutableList<IHotkeyTogglable> OPTIONS = ImmutableList.of(
DISABLE_ARMOR_STAND_RENDERING,
Expand Down
Loading

0 comments on commit 5456fb7

Please sign in to comment.