From 4d1431ac984c32590db6d431496efb1acbc7f7ed Mon Sep 17 00:00:00 2001 From: Hugo Landrin Date: Fri, 15 Mar 2024 08:05:47 +0100 Subject: [PATCH] Update to 24w10a (#90) * Remove unused mixin * Update to 24w10a * Update sparse stuff --- gradle.properties | 8 +++--- .../terraform/dirt/TillableBlockRegistry.java | 4 +-- .../merchant/TerraformSaplingTradeHelper.java | 3 ++- .../sign/SpriteIdentifierRegistry.java | 25 ------------------- .../sign/mixin/MixinTexturedRenderLayers.java | 22 ---------------- .../wood/block/BareSmallLogBlock.java | 2 +- .../resources/mixins.terraform-signs.json | 3 +-- .../wood/test/TerraformWoodTestClient.java | 6 ----- 8 files changed, 10 insertions(+), 63 deletions(-) delete mode 100644 terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/SpriteIdentifierRegistry.java delete mode 100644 terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/mixin/MixinTexturedRenderLayers.java diff --git a/gradle.properties b/gradle.properties index d95cf70a..90a77153 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true maven_group=com.terraformersmc.terraform-api -version=10.0.0-alpha.6 +version=10.0.0-alpha.7 -minecraft_version=24w07a -yarn_mappings=24w07a+build.4 +minecraft_version=24w10a +yarn_mappings=24w10a+build.7 loader_version=0.15.7 -fabric_version=0.96.3+1.20.5 +fabric_version=0.96.8+1.20.5 diff --git a/terraform-dirt-api-v1/src/main/java/com/terraformersmc/terraform/dirt/TillableBlockRegistry.java b/terraform-dirt-api-v1/src/main/java/com/terraformersmc/terraform/dirt/TillableBlockRegistry.java index a485aa87..e2e3af13 100644 --- a/terraform-dirt-api-v1/src/main/java/com/terraformersmc/terraform/dirt/TillableBlockRegistry.java +++ b/terraform-dirt-api-v1/src/main/java/com/terraformersmc/terraform/dirt/TillableBlockRegistry.java @@ -16,8 +16,8 @@ * {@link TerraformDirtRegistry}. */ public abstract class TillableBlockRegistry extends HoeItem { - private TillableBlockRegistry(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { - super(material, attackDamage, attackSpeed, settings); + private TillableBlockRegistry(ToolMaterial material, Settings settings) { + super(material, settings); } /** diff --git a/terraform-tree-api-v1/src/main/java/com/terraformersmc/terraform/tree/merchant/TerraformSaplingTradeHelper.java b/terraform-tree-api-v1/src/main/java/com/terraformersmc/terraform/tree/merchant/TerraformSaplingTradeHelper.java index 8e86865e..d722cc7c 100644 --- a/terraform-tree-api-v1/src/main/java/com/terraformersmc/terraform/tree/merchant/TerraformSaplingTradeHelper.java +++ b/terraform-tree-api-v1/src/main/java/com/terraformersmc/terraform/tree/merchant/TerraformSaplingTradeHelper.java @@ -8,6 +8,7 @@ import net.minecraft.util.math.random.Random; import net.minecraft.village.TradeOffer; import net.minecraft.village.TradeOffers; +import net.minecraft.village.TradedItem; /** * A helper class for merchant trades regarding saplings. @@ -35,7 +36,7 @@ public SellSaplingFactory(ItemConvertible sapling) { @Override public TradeOffer create(Entity entity, Random random) { - return new TradeOffer(new ItemStack(Items.EMERALD, 5), this.sapling, 8, 1, 0.05f); + return new TradeOffer(new TradedItem(Items.EMERALD, 5), this.sapling, 8, 1, 0.05f); } } } diff --git a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/SpriteIdentifierRegistry.java b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/SpriteIdentifierRegistry.java deleted file mode 100644 index cab48596..00000000 --- a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/SpriteIdentifierRegistry.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.terraformersmc.terraform.sign; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import net.minecraft.client.util.SpriteIdentifier; - -public class SpriteIdentifierRegistry { - public static final SpriteIdentifierRegistry INSTANCE = new SpriteIdentifierRegistry(); - private final List identifiers; - - private SpriteIdentifierRegistry() { - identifiers = new ArrayList<>(); - } - - public void addIdentifier(SpriteIdentifier sprite) { - this.identifiers.add(sprite); - } - - public Collection getIdentifiers() { - return Collections.unmodifiableList(identifiers); - } -} diff --git a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/mixin/MixinTexturedRenderLayers.java b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/mixin/MixinTexturedRenderLayers.java deleted file mode 100644 index 7ed14ed6..00000000 --- a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/sign/mixin/MixinTexturedRenderLayers.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.terraformersmc.terraform.sign.mixin; - -import java.util.function.Consumer; - -import com.terraformersmc.terraform.sign.SpriteIdentifierRegistry; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.render.TexturedRenderLayers; -import net.minecraft.client.util.SpriteIdentifier; - -@Mixin(TexturedRenderLayers.class) -public class MixinTexturedRenderLayers { - @Inject(method = "addDefaultTextures", at = @At("RETURN")) - private static void terraformWood$injectSignTextures(Consumer consumer, CallbackInfo ci) { - for (SpriteIdentifier identifier: SpriteIdentifierRegistry.INSTANCE.getIdentifiers()) { - consumer.accept(identifier); - } - } -} diff --git a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/BareSmallLogBlock.java b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/BareSmallLogBlock.java index 1e55fe65..5f0b6605 100644 --- a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/BareSmallLogBlock.java +++ b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/BareSmallLogBlock.java @@ -317,7 +317,7 @@ public BlockState mirror(BlockState state, BlockMirror mirror) { } @Override - public boolean canPathfindThrough(BlockState state, BlockView view, BlockPos pos, NavigationType blockPlacementEnvironment_1) { + public boolean canPathfindThrough(BlockState state, NavigationType type) { return false; } diff --git a/terraform-wood-api-v1/src/main/resources/mixins.terraform-signs.json b/terraform-wood-api-v1/src/main/resources/mixins.terraform-signs.json index f34e055e..9dce9aa5 100644 --- a/terraform-wood-api-v1/src/main/resources/mixins.terraform-signs.json +++ b/terraform-wood-api-v1/src/main/resources/mixins.terraform-signs.json @@ -6,8 +6,7 @@ "MixinHangingSignBlockEntityRenderer", "MixinHangingSignEditScreen", "MixinSignBlockEntityRenderer", - "MixinSignEditScreen", - "MixinTexturedRenderLayers" + "MixinSignEditScreen" ], "mixins": [ "MixinAbstractBlockSettings", diff --git a/terraform-wood-api-v1/src/testmod/java/com/terraformersmc/terraform/wood/test/TerraformWoodTestClient.java b/terraform-wood-api-v1/src/testmod/java/com/terraformersmc/terraform/wood/test/TerraformWoodTestClient.java index d46f2bf1..f72697b8 100644 --- a/terraform-wood-api-v1/src/testmod/java/com/terraformersmc/terraform/wood/test/TerraformWoodTestClient.java +++ b/terraform-wood-api-v1/src/testmod/java/com/terraformersmc/terraform/wood/test/TerraformWoodTestClient.java @@ -1,19 +1,13 @@ package com.terraformersmc.terraform.wood.test; import com.terraformersmc.terraform.boat.api.client.TerraformBoatClientHelper; -import com.terraformersmc.terraform.sign.SpriteIdentifierRegistry; import net.fabricmc.api.ClientModInitializer; -import net.minecraft.client.render.TexturedRenderLayers; -import net.minecraft.client.util.SpriteIdentifier; public class TerraformWoodTestClient implements ClientModInitializer { @Override public void onInitializeClient() { TerraformBoatClientHelper.registerModelLayers(TerraformWoodTest.CUSTOM_BOAT_ID, false); TerraformBoatClientHelper.registerModelLayers(TerraformWoodTest.CUSTOM_RAFT_ID, true); - - SpriteIdentifierRegistry.INSTANCE.addIdentifier(new SpriteIdentifier(TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, TerraformWoodTest.SIGN_TEXTURE_ID)); - SpriteIdentifierRegistry.INSTANCE.addIdentifier(new SpriteIdentifier(TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, TerraformWoodTest.HANGING_SIGN_TEXTURE_ID)); } }