This commit is contained in:
parent
40de5445d1
commit
9dde7b4288
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.4**
|
||||
* Fix Crash When Sneak-Using Dye On A Block
|
||||
|
||||
**1.0.3**
|
||||
* Fix Gravity Crash
|
||||
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.9.2+build.206
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.3
|
||||
mod_version = 1.0.4
|
||||
maven_group = com.thebrokenrail
|
||||
|
||||
# Dependencies
|
||||
|
@ -106,15 +106,17 @@ public class PhaseShifterBlock extends EnergyBlock {
|
||||
UseBlockCallback.EVENT.register((player, world, hand, hit) -> {
|
||||
if (!player.isSpectator() && player.shouldCancelInteraction()) {
|
||||
BlockState state = world.getBlockState(hit.getBlockPos());
|
||||
ItemStack stack = player.getStackInHand(hand);
|
||||
if (stack.getItem() instanceof DyeItem) {
|
||||
DyeColor newColor = ((DyeItem) stack.getItem()).getColor();
|
||||
if (state.get(PhaseShifterBlock.COLOR) != newColor) {
|
||||
world.setBlockState(hit.getBlockPos(), state.with(PhaseShifterBlock.COLOR, newColor));
|
||||
if (!player.isCreative()) {
|
||||
stack.decrement(1);
|
||||
if (state.getBlock() == PhaseShifterBlock.this) {
|
||||
ItemStack stack = player.getStackInHand(hand);
|
||||
if (stack.getItem() instanceof DyeItem) {
|
||||
DyeColor newColor = ((DyeItem) stack.getItem()).getColor();
|
||||
if (state.get(PhaseShifterBlock.COLOR) != newColor) {
|
||||
world.setBlockState(hit.getBlockPos(), state.with(PhaseShifterBlock.COLOR, newColor));
|
||||
if (!player.isCreative()) {
|
||||
stack.decrement(1);
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user