mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 22:16:14 +00:00
fix: Dye Mention.
This commit is contained in:
parent
be0982431b
commit
4026ef2664
1 changed files with 12 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ import net.minecraft.block.CommandBlock;
|
||||||
import net.minecraft.block.entity.CommandBlockBlockEntity;
|
import net.minecraft.block.entity.CommandBlockBlockEntity;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.nbt.NbtCompound;
|
import net.minecraft.nbt.NbtCompound;
|
||||||
import net.minecraft.network.ClientConnection;
|
import net.minecraft.network.ClientConnection;
|
||||||
|
|
@ -33,6 +34,8 @@ public class CommandCore {
|
||||||
|
|
||||||
private boolean shouldRefill = false;
|
private boolean shouldRefill = false;
|
||||||
|
|
||||||
|
private DimensionType oldDimension;
|
||||||
|
|
||||||
public boolean runFillCommand = true;
|
public boolean runFillCommand = true;
|
||||||
|
|
||||||
public boolean clientPlayerEntityFilled = false;
|
public boolean clientPlayerEntityFilled = false;
|
||||||
|
|
@ -101,16 +104,21 @@ public class CommandCore {
|
||||||
|
|
||||||
if (networkHandler == null || withPos == null || !ready) return;
|
if (networkHandler == null || withPos == null || !ready) return;
|
||||||
|
|
||||||
|
final ClientPlayerEntity player = client.player;
|
||||||
|
final ClientWorld world = client.world;
|
||||||
|
|
||||||
|
if (player == null || world == null) return;
|
||||||
|
|
||||||
|
if (oldDimension != null && !oldDimension.equals(world.getDimension())) move(client.player.getPos());
|
||||||
|
|
||||||
|
oldDimension = world.getDimension();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (int x = withPos.getMinX(); x <= withPos.getMaxX(); x++) {
|
for (int x = withPos.getMinX(); x <= withPos.getMaxX(); x++) {
|
||||||
for (int y = withPos.getMinY(); y <= withPos.getMaxY(); y++) {
|
for (int y = withPos.getMinY(); y <= withPos.getMaxY(); y++) {
|
||||||
for (int z = withPos.getMaxZ(); z <= withPos.getMaxZ(); z++) {
|
for (int z = withPos.getMaxZ(); z <= withPos.getMaxZ(); z++) {
|
||||||
final BlockPos pos = new BlockPos(x, y, z);
|
final BlockPos pos = new BlockPos(x, y, z);
|
||||||
|
|
||||||
final ClientWorld world = client.world;
|
|
||||||
|
|
||||||
if (world == null) return;
|
|
||||||
|
|
||||||
final Block block = world.getBlockState(pos).getBlock();
|
final Block block = world.getBlockState(pos).getBlock();
|
||||||
|
|
||||||
if (block instanceof CommandBlock) continue;
|
if (block instanceof CommandBlock) continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue