Skip to content

Commit

Permalink
port to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dqu1J committed Feb 12, 2024
1 parent 59c0764 commit 01c77ae
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.7.1'
id 'maven-publish'
}
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.2
minecraft_version=1.20.4
loader_version=0.14.4
# Mod Properties
mod_version=6.0.2
maven_group=AdditionalAdditions
archives_base_name=AdditionalAdditions
# Dependencies
fabric_version=0.90.0+1.20.2
modmenu_version=7.1.0
libgui_version=8.0.1+1.20
fabric_version=0.96.0+1.20.4
modmenu_version=9.0.0
libgui_version=9.2.2+1.20.2
lambdynamiclights_version=2.3.1+1.20.1
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.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package dqu.additionaladditions.block;

import com.mojang.serialization.MapCodec;
import dqu.additionaladditions.registry.AdditionalItems;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.AnvilBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FallingBlock;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -16,12 +18,18 @@
public class GlowStickBlock extends FallingBlock {
public static final VoxelShape shape = Block.box(2, 0, 2,14, 2, 14);
public static final BooleanProperty FLIPPED = BooleanProperty.create("flipped");
public static final MapCodec<GlowStickBlock> CODEC = simpleCodec(GlowStickBlock::new);

public GlowStickBlock(Properties settings) {
super(settings);
registerDefaultState(getStateDefinition().any().setValue(FLIPPED, false));
}

@Override
protected MapCodec<? extends FallingBlock> codec() {
return CODEC;
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
stateManager.add(FLIPPED);
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/dqu/additionaladditions/block/PatinaBlock.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package dqu.additionaladditions.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.world.level.block.FallingBlock;

public class PatinaBlock extends FallingBlock {
public static final MapCodec<PatinaBlock> CODEC = simpleCodec(PatinaBlock::new);

@Override
protected MapCodec<? extends FallingBlock> codec() {
return CODEC;
}

public PatinaBlock(Properties properties) {
super(properties);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/dqu/additionaladditions/gui/ConfigGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.contents.LiteralContents;
import net.minecraft.network.chat.contents.PlainTextContents;
import net.minecraft.network.chat.contents.TranslatableContents;

public class ConfigGui extends LightweightGuiDescription {
private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done", null, new String[]{}));
private static final Component SCREEN_TITLE = MutableComponent.create(new LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD).append(MutableComponent.create(new LiteralContents("options.title")));
private static final Component SCREEN_TITLE = MutableComponent.create(new PlainTextContents.LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD).append(MutableComponent.create(new PlainTextContents.LiteralContents("options.title")));

public ConfigGui() {
WGridPanel root = (WGridPanel) rootPanel;
Expand All @@ -27,12 +27,12 @@ public ConfigGui() {

for (ConfigValues value : ConfigValues.values()) {
if (value.getType() == ConfigValueType.BOOLEAN) {
WToggleButton button = new WToggleButton(MutableComponent.create(new LiteralContents(value.getProperty().key())));
WToggleButton button = new WToggleButton(MutableComponent.create(new PlainTextContents.LiteralContents(value.getProperty().key())));
button.setToggle(Config.getBool(value));
button.setOnToggle(on -> Config.set(value, on));
box.add(button);
} else {
WLabel text = new WLabel(MutableComponent.create(new LiteralContents(value.getProperty().key() + " | Unable to manage ingame. Edit in file instead.")));
WLabel text = new WLabel(MutableComponent.create(new PlainTextContents.LiteralContents(value.getProperty().key() + " | Unable to manage ingame. Edit in file instead.")));
box.add(text);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dqu/additionaladditions/gui/ConfirmGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.contents.LiteralContents;
import net.minecraft.network.chat.contents.PlainTextContents;
import net.minecraft.network.chat.contents.TranslatableContents;

public class ConfirmGui extends LightweightGuiDescription {
private static final Component SCREEN_TITLE = MutableComponent.create(new LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD);
private static final Component SCREEN_TITLE = MutableComponent.create(new PlainTextContents.LiteralContents("Additional Additions ")).withStyle(ChatFormatting.BOLD);
private static final Component OPTION_DONE = MutableComponent.create(new TranslatableContents("gui.done", null, new String[]{}));
private static final Component DESCRIPTION = MutableComponent.create(new TranslatableContents("additionaladditions.gui.config.restart", null, new String[]{}));

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dqu/additionaladditions/mixin/AxeItemMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

@Mixin(AxeItem.class)
public class AxeItemMixin {
@Inject(method = "useOn", at = @At(value = "FIELD", target = "Lnet/minecraft/sounds/SoundEvents;AXE_SCRAPE:Lnet/minecraft/sounds/SoundEvent;"), locals = LocalCapture.CAPTURE_FAILSOFT)
private void spawnCopperPatina(UseOnContext iuc, CallbackInfoReturnable<InteractionResult> cir, Level world, BlockPos blockPos, Player playerEntity, BlockState blockState, Optional optional, Optional optional2, Optional optional3, ItemStack itemStack, Optional optional4) {
@Inject(method = "evaluateNewBlockState", at = @At(value = "FIELD", target = "Lnet/minecraft/sounds/SoundEvents;AXE_SCRAPE:Lnet/minecraft/sounds/SoundEvent;"), locals = LocalCapture.CAPTURE_FAILSOFT)
private void spawnCopperPatina(Level world, BlockPos blockPos, Player player, BlockState blockState, CallbackInfoReturnable<Optional<BlockState>> cir, Optional optional, Optional optional2) {
if (!Config.getBool(ConfigValues.COPPER_PATINA)) return;
ItemStack stack = new ItemStack(AdditionalBlocks.COPPER_PATINA);
ItemEntity itemEntity = new ItemEntity(world, blockPos.getX(), blockPos.getY(), blockPos.getZ(), stack);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
],
"depends": {
"fabricloader": ">=0.14.4",
"minecraft": ">=1.19.1",
"minecraft": ">=1.20.3",
"fabric-api": "*",
"java": ">=17"
},
Expand Down

0 comments on commit 01c77ae

Please sign in to comment.