Skip to content

Commit

Permalink
Fix SignEditScreen mixin crash.
Browse files Browse the repository at this point in the history
- Fix SignEditScreen mixin crash at client join
- Assign correct block state including burnable() in PillarLogHelper
  • Loading branch information
gniftygnome committed Apr 21, 2023
1 parent e055291 commit 471aa69
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2G
fabric.loom.multiProjectOptimisation=true

maven_group=com.terraformersmc.terraform-api
version=7.0.0-alpha.3
version=7.0.0-alpha.4

minecraft_version=23w16a
yarn_mappings=23w16a+build.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.render.block.entity.HangingSignBlockEntityRenderer;
import net.minecraft.client.util.SpriteIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.terraformersmc.terraform.sign.TerraformSign;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block;
import net.minecraft.block.WoodType;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.model.Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.WoodType;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.screen.ingame.SignEditScreen;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

Expand All @@ -23,7 +22,7 @@ public class MixinSignEditScreen {
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/TexturedRenderLayers;getSignTextureId(Lnet/minecraft/block/WoodType;)Lnet/minecraft/client/util/SpriteIdentifier;")
)
@SuppressWarnings("unused")
private SpriteIdentifier getTerraformSignTextureId(WoodType type, Operation<SpriteIdentifier> original, MatrixStack matrices, VertexConsumerProvider.Immediate vertexConsumers, BlockState state) {
private SpriteIdentifier getTerraformSignTextureId(WoodType type, Operation<SpriteIdentifier> original, DrawableHelper drawContext, BlockState state) {
if (state.getBlock() instanceof TerraformSign signBlock) {
return new SpriteIdentifier(TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, signBlock.getTexture());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static BareSmallLogBlock of(MapColor color) {
Block.Settings.of(
Material.GENERIC,
color
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand All @@ -125,7 +125,7 @@ public static BareSmallLogBlock of(MapColor wood, MapColor bark) {
Block.Settings.of(
Material.GENERIC,
(state) -> state.get(UP) ? wood : bark
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.terraformersmc.terraform.wood.block;

import net.minecraft.block.*;
import net.minecraft.block.enums.Instrument;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.Direction;

Expand All @@ -18,7 +19,7 @@ public static PillarBlock of(MapColor color) {
Block.Settings.of(
Material.GENERIC,
color
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).method_51368(Instrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand All @@ -35,7 +36,7 @@ public static PillarBlock of(MapColor wood, MapColor bark) {
Block.Settings.of(
Material.GENERIC,
(state) -> Direction.Axis.Y.equals(state.get(PillarBlock.AXIS)) ? wood : bark
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).method_51368(Instrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand All @@ -51,7 +52,7 @@ public static PillarBlock ofNether(MapColor color) {
Block.Settings.of(
Material.GENERIC,
color
).strength(2.0F).sounds(BlockSoundGroup.NETHER_STEM)
).method_51368(Instrument.BASS).strength(2.0F).sounds(BlockSoundGroup.NETHER_STEM)
);
}

Expand All @@ -68,7 +69,7 @@ public static PillarBlock ofNether(MapColor wood, MapColor bark) {
Block.Settings.of(
Material.GENERIC,
(state) -> Direction.Axis.Y.equals(state.get(PillarBlock.AXIS)) ? wood : bark
).strength(2.0F).sounds(BlockSoundGroup.NETHER_STEM)
).method_51368(Instrument.BASS).strength(2.0F).sounds(BlockSoundGroup.NETHER_STEM)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static QuarterLogBlock of(MapColor color) {
Block.Settings.of(
Material.GENERIC,
color
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public static QuarterLogBlock of(MapColor wood, MapColor bark) {
case NORTHEAST, NORTHWEST -> wood;
};
}
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static SmallLogBlock of(Block leaves, MapColor color) {
Block.Settings.of(
Material.GENERIC,
(state) -> state.get(HAS_LEAVES) ? leaves.getDefaultMapColor() : color
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand All @@ -111,7 +111,7 @@ public static SmallLogBlock of(Block leaves, MapColor wood, MapColor bark) {
Material.GENERIC,
(state) -> state.get(HAS_LEAVES) ? leaves.getDefaultMapColor() :
state.get(UP) ? wood : bark
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static PillarBlock of(MapColor color) {
Block.Settings.of(
Material.GENERIC,
color
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}

Expand All @@ -71,7 +71,7 @@ public static PillarBlock of(MapColor wood, MapColor bark) {
Block.Settings.of(
Material.GENERIC,
(state) -> Direction.Axis.Y.equals(state.get(PillarBlock.AXIS)) ? wood : bark
).strength(2.0F).sounds(BlockSoundGroup.WOOD)
).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()
);
}
}

0 comments on commit 471aa69

Please sign in to comment.