Fix Bugs
This commit is contained in:
parent
cfa6e499ce
commit
221f6e2336
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**1.0.13**
|
||||||
|
* Fix Bugs
|
||||||
|
|
||||||
**1.0.12**
|
**1.0.12**
|
||||||
* Improve Balancing
|
* Improve Balancing
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.7.10+build.191
|
fabric_loader_version = 0.7.10+build.191
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.12
|
mod_version = 1.0.13
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
archives_base_name = reliccraft
|
archives_base_name = reliccraft
|
||||||
|
|
||||||
|
@ -46,14 +46,15 @@ public abstract class AbstractDragonEggHolderBlock extends Block implements Bloc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
Inventory blockEntity = (Inventory) world.getBlockEntity(pos);
|
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||||
|
|
||||||
if (blockEntity != null) {
|
if (blockEntity instanceof Inventory) {
|
||||||
|
Inventory inventory = (Inventory) blockEntity;
|
||||||
ItemStack stack = player.getStackInHand(hand);
|
ItemStack stack = player.getStackInHand(hand);
|
||||||
|
|
||||||
if (!stack.isEmpty()) {
|
if (!stack.isEmpty()) {
|
||||||
if (blockEntity.isValidInvStack(0, stack) && blockEntity.getInvStack(0).isEmpty()) {
|
if (inventory.isValidInvStack(0, stack) && inventory.getInvStack(0).isEmpty()) {
|
||||||
blockEntity.setInvStack(0, stack.split(1));
|
inventory.setInvStack(0, stack.split(1));
|
||||||
if (!world.isClient()) {
|
if (!world.isClient()) {
|
||||||
grantAdvancement(player);
|
grantAdvancement(player);
|
||||||
}
|
}
|
||||||
@ -62,16 +63,16 @@ public abstract class AbstractDragonEggHolderBlock extends Block implements Bloc
|
|||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!blockEntity.getInvStack(0).isEmpty()) {
|
if (!inventory.getInvStack(0).isEmpty()) {
|
||||||
player.inventory.offerOrDrop(world, blockEntity.getInvStack(0));
|
player.inventory.offerOrDrop(world, inventory.getInvStack(0));
|
||||||
blockEntity.removeInvStack(0);
|
inventory.removeInvStack(0);
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ActionResult.PASS;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,9 @@ public class UpdateTimeDilationS2CPacket {
|
|||||||
TimeDilaterItem.TimeSpeed speed = TimeDilaterItem.TimeSpeed.valueOf(buf.readString());
|
TimeDilaterItem.TimeSpeed speed = TimeDilaterItem.TimeSpeed.valueOf(buf.readString());
|
||||||
|
|
||||||
MinecraftClient client = MinecraftClient.getInstance();
|
MinecraftClient client = MinecraftClient.getInstance();
|
||||||
assert client.world != null;
|
|
||||||
|
|
||||||
((TimeDilaterItem.DilatedWorld) client.world).setTimeSpeed(speed);
|
if (client.world != null) {
|
||||||
|
((TimeDilaterItem.DilatedWorld) client.world).setTimeSpeed(speed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user