Skip to content

Commit

Permalink
Update to 1.21.4-pre1.
Browse files Browse the repository at this point in the history
- Update to 1.21.4-pre1
  • Loading branch information
gniftygnome committed Nov 21, 2024
1 parent 4367369 commit 1938d4a
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 81 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'idea'
id 'eclipse'
id 'fabric-loom' version '1.7.+'
id 'fabric-loom' version '1.8.+'
}

allprojects {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

maven_group=com.terraformersmc.terraform-api
version=12.0.0-beta.1
version=13.0.0-alpha.1

minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.16.7
fabric_version=0.106.1+1.21.2
minecraft_version=1.21.4-pre1
yarn_mappings=1.21.4-pre1+build.2
loader_version=0.16.9
fabric_version=0.109.1+1.21.4
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.terraformersmc.terraform.sign.impl.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.WoodType;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.model.Model;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.AbstractSignBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;

@Environment(EnvType.CLIENT)
@Mixin(AbstractSignBlockEntityRenderer.class)
public abstract class MixinAbstractSignBlockEntityRenderer {
@Unique
protected SignBlockEntity terraform$renderedBlockEntity;

@WrapOperation(
method = "render(Lnet/minecraft/block/entity/SignBlockEntity;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/block/BlockState;Lnet/minecraft/block/AbstractSignBlock;Lnet/minecraft/block/WoodType;Lnet/minecraft/client/model/Model;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/AbstractSignBlockEntityRenderer;renderSign(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/block/WoodType;Lnet/minecraft/client/model/Model;)V")
)
@SuppressWarnings("unused")
private void terraformWood$setRenderedBlockEntity(AbstractSignBlockEntityRenderer instance, MatrixStack matrices, VertexConsumerProvider verticesProvider, int light, int overlay, WoodType type, Model model, Operation<Void> original, @Local SignBlockEntity blockEntity) {
this.terraform$renderedBlockEntity = blockEntity;
original.call(instance, matrices, verticesProvider, light, overlay, type, model);
this.terraform$renderedBlockEntity = null;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
package com.terraformersmc.terraform.sign.impl.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.terraformersmc.terraform.sign.api.TerraformSign;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.WoodType;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.model.Model;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.HangingSignBlockEntityRenderer;
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(SignBlockEntityRenderer.class)
@Environment(EnvType.CLIENT)
public abstract class MixinSignBlockEntityRenderer {
@Unique
protected SignBlockEntity terraform$renderedBlockEntity;

@WrapOperation(
method = "render(Lnet/minecraft/block/entity/SignBlockEntity;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/block/BlockState;Lnet/minecraft/block/AbstractSignBlock;Lnet/minecraft/block/WoodType;Lnet/minecraft/client/model/Model;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/SignBlockEntityRenderer;renderSign(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/block/WoodType;Lnet/minecraft/client/model/Model;)V")
)
@SuppressWarnings("unused")
private void terraformWood$setRenderedBlockEntity(SignBlockEntityRenderer instance, MatrixStack matrices, VertexConsumerProvider verticesProvider, int light, int overlay, WoodType type, Model model, Operation<Void> original, SignBlockEntity signBlockEntity) {
this.terraform$renderedBlockEntity = signBlockEntity;
original.call(instance, matrices, verticesProvider, light, overlay, type, model);
this.terraform$renderedBlockEntity = null;
}

@Mixin({SignBlockEntityRenderer.class, HangingSignBlockEntityRenderer.class})
public abstract class MixinSignBlockEntityRenderer extends MixinAbstractSignBlockEntityRenderer {
@Inject(method = "getTextureId", at = @At("HEAD"), cancellable = true)
private void terraformWood$rendererSignTextureId(CallbackInfoReturnable<SpriteIdentifier> cir) {
private void terraformWood$rendererSignTextureId(WoodType woodType, CallbackInfoReturnable<SpriteIdentifier> cir) {
if (this.terraform$renderedBlockEntity != null) {
if (this.terraform$renderedBlockEntity.getCachedState().getBlock() instanceof TerraformSign signBlock) {
cir.setReturnValue(new SpriteIdentifier(TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, signBlock.getTexture()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"package": "com.terraformersmc.terraform.sign.impl.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
"MixinHangingSignBlockEntityRenderer",
"MixinAbstractSignBlockEntityRenderer",
"MixinHangingSignEditScreen",
"MixinSignBlockEntityRenderer",
"MixinSignEditScreen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void onInitialize() {
Block customLog = new PillarBlock(PillarLogHelper.createSettings(MapColor.RED, MapColor.BLUE).registryKey(RegistryKey.of(RegistryKeys.BLOCK, CUSTOM_LOG_ID)));
Block customPlanks = new Block(AbstractBlock.Settings.create().mapColor(MapColor.RED).registryKey(RegistryKey.of(RegistryKeys.BLOCK, CUSTOM_PLANKS_ID)));

BlockItem customLogItem = new BlockItem(customLog, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_LOG_ID)));
BlockItem customPlanksItem = new BlockItem(customPlanks, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_PLANKS_ID)));
BlockItem customLogItem = new BlockItem(customLog, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_LOG_ID)).useBlockPrefixedTranslationKey());
BlockItem customPlanksItem = new BlockItem(customPlanks, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_PLANKS_ID)).useBlockPrefixedTranslationKey());

// Boats
customBoatItem = TerraformBoatItemHelper.registerBoatItem(CUSTOM_BOATS_ID, false);
Expand All @@ -69,8 +69,8 @@ public void onInitialize() {
Block wallHangingSign = new TerraformWallHangingSignBlock(HANGING_SIGN_TEXTURE_ID, HANGING_SIGN_GUI_TEXTURE_ID, AbstractBlock.Settings.copy(Blocks.OAK_WALL_HANGING_SIGN).sounds(BlockSoundGroup.SCULK_SENSOR).lootTable(hangingSign.getLootTableKey()).registryKey(RegistryKey.of(RegistryKeys.BLOCK, CUSTOM_WALL_HANGING_SIGN_ID)));
Registry.register(Registries.BLOCK, CUSTOM_WALL_HANGING_SIGN_ID, wallHangingSign);

SignItem signItem = new SignItem(sign, wallSign, new Item.Settings().maxCount(16).registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_SIGN_ID)));
HangingSignItem hangingSignItem = new HangingSignItem(hangingSign, wallHangingSign, new Item.Settings().maxCount(16).registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_HANGING_SIGN_ID)));
SignItem signItem = new SignItem(sign, wallSign, new Item.Settings().maxCount(16).registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_SIGN_ID)).useBlockPrefixedTranslationKey());
HangingSignItem hangingSignItem = new HangingSignItem(hangingSign, wallHangingSign, new Item.Settings().maxCount(16).registryKey(RegistryKey.of(RegistryKeys.ITEM, CUSTOM_HANGING_SIGN_ID)).useBlockPrefixedTranslationKey());

// Register
customLogItem.appendBlocks(Item.BLOCK_ITEMS, customLogItem);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_chest_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_chest_raft"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_hanging_sign"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_log"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_planks"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_raft"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "terraform:item/custom_sign"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@
"entity.terraform.custom_chest_raft": "Custom Raft with Chest",

"itemGroup.terraform.items": "Terraform Wood Test",
"item.terraform.custom_log": "Custom Log",
"item.terraform.stripped_custom_log": "Stripped Custom Log",
"item.terraform.stripped_custom_wood": "Stripped Custom Wood",
"item.terraform.custom_wood": "Custom Wood",
"item.terraform.custom_leaves": "Custom Leaves",
"item.terraform.custom_sapling": "Custom Sapling",
"item.terraform.potted_custom_sapling": "Potted Custom Sapling",
"item.terraform.custom_planks": "Custom Planks",
"item.terraform.custom_stairs": "Custom Stairs",
"item.terraform.custom_slab": "Custom Slab",
"item.terraform.custom_sign": "Custom Sign",
"item.terraform.custom_hanging_sign": "Custom Hanging Sign",
"item.terraform.custom_button": "Custom Button",
"item.terraform.custom_pressure_plate": "Custom Pressure Plate",
"item.terraform.custom_fence": "Custom Fence",
"item.terraform.custom_fence_gate": "Custom Fence Gate",
"item.terraform.custom_door": "Custom Door",
"item.terraform.custom_trapdoor": "Custom Trapdoor",

"item.terraform.custom_boat": "Custom Boat",
"item.terraform.custom_chest_boat": "Custom Boat with Chest",
"item.terraform.custom_raft": "Custom Raft",
Expand Down

0 comments on commit 1938d4a

Please sign in to comment.