Lots of work

This commit is contained in:
Vincent Lee committed 2020-06-26 09:59:25 -05:00
1 parent 98b74dc69b
commit 17ccb624f8
236 files changed
+839 -1015

No files matched your search

@@ -8,8 +8,6 @@
*/
package vazkii.botania.common.block;
import com.mojang.datafixers.Dynamic;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.MovingPistonBlock;
@@ -28,12 +26,12 @@ import net.minecraft.state.properties.PistonType;
import net.minecraft.tileentity.PistonTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.RegistryKey;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.GlobalPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.storage.WorldSavedData;
import net.minecraftforge.common.MinecraftForge;
@@ -74,12 +72,12 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
@Override
public void onReplaced(@Nonnull BlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) {
if (!world.isRemote) {
mapCoords(world.getDimension().getType(), pos, 2);
mapCoords(world.func_234923_W_(), pos, 2);
}
}
private void mapCoords(DimensionType type, BlockPos pos, int time) {
coordsToCheck.put(GlobalPos.of(type, pos), time);
private void mapCoords(RegistryKey<World> type, BlockPos pos, int time) {
coordsToCheck.put(GlobalPos.func_239648_a_(type, pos), time);
}
private void decrCoords(GlobalPos key) {
@@ -101,7 +99,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
if (server == null) {
return null;
}
return server.getWorld(key.getDimension()).getTileEntity(key.getPos());
return server.getWorld(key.func_239646_a_()).getTileEntity(key.getPos());
}
private BlockState getStateAt(GlobalPos key) {
@@ -109,7 +107,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
if (server == null) {
return Blocks.AIR.getDefaultState();
}
return server.getWorld(key.getDimension()).getBlockState(key.getPos());
return server.getWorld(key.func_239646_a_()).getBlockState(key.getPos());
}
@Override
@@ -122,7 +120,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
spawnAsEntity(world, pos, new ItemStack(this));
world.destroyBlock(pos, false);
} else {
GlobalPos clicked = GlobalPos.of(world.getDimension().getType(), pos.toImmutable());
GlobalPos clicked = GlobalPos.func_239648_a_(world.func_234923_W_(), pos.toImmutable());
if (ItemTwigWand.getBindMode(stack)) {
activeBindingAttempts.put(player.getUniqueID(), clicked);
world.playSound(null, pos, ModSounds.ding, SoundCategory.BLOCKS, 0.5F, 1F);
@@ -191,7 +189,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
if (event.type == TickEvent.Type.SERVER && event.phase == TickEvent.Phase.END) {
MinecraftServer server = ServerLifecycleHooks.getCurrentServer();
for (GlobalPos s : coordsToCheck.keySet()) {
ServerWorld world = server.getWorld(s.getDimension());
ServerWorld world = server.getWorld(s.func_239646_a_());
WorldData data = WorldData.get(world);
decrCoords(s);