From ef4b450dc42019cf9e77cde997327a9ff01de532 Mon Sep 17 00:00:00 2001 From: darkevilmac Date: Sat, 25 Jun 2016 00:32:01 -0700 Subject: [PATCH] Reformat + Optimize Imports. --- build.gradle | 18 +-- .../darkevilmac/movingworld/MovingWorld.java | 12 +- .../client/gui/MovingWorldConfigGUI.java | 3 +- .../client/render/MobileChunkRenderer.java | 13 ++- .../client/render/RenderMovingWorld.java | 6 +- .../asm/coremod/MovingWorldCoreMod.java | 1 + .../asm/coremod/MovingWorldModContainer.java | 1 + .../asm/mixin/core/block/MixinBlockSkull.java | 8 +- .../block/property/MixinPropertyEnum.java | 4 +- .../block/property/MixinPropertyInteger.java | 6 +- .../asm/mixin/core/entity/MixinEntity.java | 4 +- .../asm/mixin/core/world/MixinWorld.java | 1 + .../common/block/BlockMovingWorldMarker.java | 5 +- .../common/chunk/ChunkCollisionHelper.java | 7 +- .../movingworld/common/chunk/ChunkIO.java | 19 ++-- .../chunk/MovingWorldAssemblyInteractor.java | 22 ++-- .../common/chunk/assembly/AssembleResult.java | 103 +++++++++--------- .../common/chunk/assembly/ChunkAssembler.java | 11 +- .../chunk/assembly/ChunkDisassembler.java | 26 +++-- .../chunk/mobilechunk/MobileChunkClient.java | 5 +- .../chunk/mobilechunk/MobileChunkServer.java | 3 +- .../chunk/mobilechunk/world/FakeWorld.java | 3 +- .../movingworld/common/config/MainConfig.java | 11 +- .../priority/AssemblePriorityConfig.java | 5 +- .../common/entity/EntityMovingWorld.java | 7 +- .../common/entity/IMixinEntity.java | 3 +- .../entity/MovingWorldCapabilities.java | 3 +- .../entity/MovingWorldHandlerClient.java | 3 +- .../entity/MovingWorldHandlerCommon.java | 5 +- .../entity/MovingWorldHandlerServer.java | 7 +- .../common/event/AssembleBlockEvent.java | 3 +- .../common/event/DisassembleBlockEvent.java | 3 +- .../common/mrot/MetaRotations.java | 17 ++- .../common/network/MovingWorldNetworking.java | 22 ++-- .../common/tile/IMovingWorldTileEntity.java | 6 +- .../movingworld/common/util/FloodFiller.java | 5 +- .../common/util/LocatedBlockList.java | 6 +- .../common/util/RotationHelper.java | 7 +- .../movingworld/common/util/Vec3dMod.java | 9 -- .../common/util/rotation/IRotationBlock.java | 4 +- .../util/rotation/IRotationProperty.java | 5 +- .../movingworld/common/world/MobileWorld.java | 3 +- 42 files changed, 235 insertions(+), 180 deletions(-) diff --git a/build.gradle b/build.gradle index 6f9d9f5f..840d5bab 100644 --- a/build.gradle +++ b/build.gradle @@ -31,10 +31,10 @@ minecraft { version = "1.10-12.18.0.1986-1.10.0" runDir = "run" - def replacementVersion = 'MOD_VERSION = \"' + project.version + '\"' + def replacementVersion = 'MOD_VERSION = \"' + project.version + '\"' - replace ("MOD_VERSION = \"@MOVINGWORLDVER@\"", - replacementVersion) + replace("MOD_VERSION = \"@MOVINGWORLDVER@\"", + replacementVersion) mappings = "snapshot_20160621" } @@ -48,7 +48,7 @@ repositories { name 'spongepowered' url 'https://repo.spongepowered.org/maven/' } - maven { + maven { url = 'http://unascribed.com/maven/releases' } } @@ -58,20 +58,20 @@ dependencies { exclude module: 'launchwrapper' exclude module: 'guava' } - - compile 'com.unascribed:lambdanetwork:1.0.0' + + compile 'com.unascribed:lambdanetwork:1.0.0' shadow 'com.unascribed:lambdanetwork:1.0.0' } shadowJar { exclude 'dummyThing' - relocate 'com.unascribed.lambdanetwork', "darkevilmac.movingworld.repackage.com.unascribed.lambdanetwork" + relocate 'com.unascribed.lambdanetwork', "darkevilmac.movingworld.repackage.com.unascribed.lambdanetwork" dependencies { include(dependency('org.spongepowered:mixin')) - include(dependency('com.unascribed:lambdanetwork')) + include(dependency('com.unascribed:lambdanetwork')) } - + classifier = 'full' } diff --git a/src/main/java/darkevilmac/movingworld/MovingWorld.java b/src/main/java/darkevilmac/movingworld/MovingWorld.java index cdacfd5c..e039da64 100644 --- a/src/main/java/darkevilmac/movingworld/MovingWorld.java +++ b/src/main/java/darkevilmac/movingworld/MovingWorld.java @@ -1,10 +1,5 @@ package darkevilmac.movingworld; -import darkevilmac.movingworld.client.ClientProxy; -import darkevilmac.movingworld.common.CommonProxy; -import darkevilmac.movingworld.common.config.MainConfig; -import darkevilmac.movingworld.common.mrot.MetaRotations; -import darkevilmac.movingworld.common.network.MovingWorldNetworking; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; @@ -12,10 +7,17 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + import org.apache.logging.log4j.Logger; import java.io.File; +import darkevilmac.movingworld.client.ClientProxy; +import darkevilmac.movingworld.common.CommonProxy; +import darkevilmac.movingworld.common.config.MainConfig; +import darkevilmac.movingworld.common.mrot.MetaRotations; +import darkevilmac.movingworld.common.network.MovingWorldNetworking; + @Mod(modid = MovingWorld.MOD_ID, name = MovingWorld.MOD_NAME, version = MovingWorld.MOD_VERSION, guiFactory = MovingWorld.MOD_GUIFACTORY) public class MovingWorld { public static final String MOD_ID = "MovingWorld"; diff --git a/src/main/java/darkevilmac/movingworld/client/gui/MovingWorldConfigGUI.java b/src/main/java/darkevilmac/movingworld/client/gui/MovingWorldConfigGUI.java index ab352694..43d17297 100644 --- a/src/main/java/darkevilmac/movingworld/client/gui/MovingWorldConfigGUI.java +++ b/src/main/java/darkevilmac/movingworld/client/gui/MovingWorldConfigGUI.java @@ -1,6 +1,5 @@ package darkevilmac.movingworld.client.gui; -import darkevilmac.movingworld.MovingWorld; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigElement; @@ -10,6 +9,8 @@ import java.util.ArrayList; import java.util.List; +import darkevilmac.movingworld.MovingWorld; + public class MovingWorldConfigGUI extends GuiConfig { public MovingWorldConfigGUI(GuiScreen parentScreen) { diff --git a/src/main/java/darkevilmac/movingworld/client/render/MobileChunkRenderer.java b/src/main/java/darkevilmac/movingworld/client/render/MobileChunkRenderer.java index 13dae896..a48c885c 100644 --- a/src/main/java/darkevilmac/movingworld/client/render/MobileChunkRenderer.java +++ b/src/main/java/darkevilmac/movingworld/client/render/MobileChunkRenderer.java @@ -1,11 +1,14 @@ package darkevilmac.movingworld.client.render; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; @@ -17,8 +20,12 @@ import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.opengl.GL11; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; + @SideOnly(Side.CLIENT) public class MobileChunkRenderer { /** diff --git a/src/main/java/darkevilmac/movingworld/client/render/RenderMovingWorld.java b/src/main/java/darkevilmac/movingworld/client/render/RenderMovingWorld.java index 38146c0e..2f0d5057 100644 --- a/src/main/java/darkevilmac/movingworld/client/render/RenderMovingWorld.java +++ b/src/main/java/darkevilmac/movingworld/client/render/RenderMovingWorld.java @@ -1,7 +1,5 @@ package darkevilmac.movingworld.client.render; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkClient; -import darkevilmac.movingworld.common.entity.EntityMovingWorld; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.culling.ICamera; import net.minecraft.client.renderer.entity.Render; @@ -9,8 +7,12 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkClient; +import darkevilmac.movingworld.common.entity.EntityMovingWorld; + public class RenderMovingWorld extends Render { public RenderMovingWorld(RenderManager renderManager) { super(renderManager); diff --git a/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldCoreMod.java b/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldCoreMod.java index 9d138bde..6d3ff138 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldCoreMod.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldCoreMod.java @@ -1,6 +1,7 @@ package darkevilmac.movingworld.common.asm.coremod; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; + import org.spongepowered.asm.launch.MixinBootstrap; import org.spongepowered.asm.mixin.MixinEnvironment; diff --git a/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldModContainer.java b/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldModContainer.java index b7bf85a5..46b5e7d2 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldModContainer.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/coremod/MovingWorldModContainer.java @@ -2,6 +2,7 @@ import com.google.common.collect.Lists; import com.google.common.eventbus.EventBus; + import net.minecraftforge.fml.common.DummyModContainer; import net.minecraftforge.fml.common.LoadController; import net.minecraftforge.fml.common.ModMetadata; diff --git a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/MixinBlockSkull.java b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/MixinBlockSkull.java index 1944d1fc..48a02e84 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/MixinBlockSkull.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/MixinBlockSkull.java @@ -1,12 +1,14 @@ package darkevilmac.movingworld.common.asm.mixin.core.block; -import darkevilmac.movingworld.common.chunk.LocatedBlock; -import darkevilmac.movingworld.common.util.RotationHelper; -import darkevilmac.movingworld.common.util.rotation.IRotationBlock; import net.minecraft.block.BlockSkull; import net.minecraft.tileentity.TileEntitySkull; + import org.spongepowered.asm.mixin.Mixin; +import darkevilmac.movingworld.common.chunk.LocatedBlock; +import darkevilmac.movingworld.common.util.RotationHelper; +import darkevilmac.movingworld.common.util.rotation.IRotationBlock; + @Mixin(BlockSkull.class) public class MixinBlockSkull implements IRotationBlock { diff --git a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyEnum.java b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyEnum.java index 75ef2b62..5674f19b 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyEnum.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyEnum.java @@ -1,14 +1,16 @@ package darkevilmac.movingworld.common.asm.mixin.core.block.property; -import darkevilmac.movingworld.common.util.rotation.IRotationProperty; import net.minecraft.block.BlockLever; import net.minecraft.block.BlockLog; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; + import org.spongepowered.asm.mixin.Mixin; +import darkevilmac.movingworld.common.util.rotation.IRotationProperty; + @Mixin(PropertyEnum.class) public class MixinPropertyEnum implements IRotationProperty { diff --git a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyInteger.java b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyInteger.java index 7e2b2a88..6b7b249d 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyInteger.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/block/property/MixinPropertyInteger.java @@ -1,11 +1,13 @@ package darkevilmac.movingworld.common.asm.mixin.core.block.property; -import darkevilmac.movingworld.common.util.RotationHelper; -import darkevilmac.movingworld.common.util.rotation.IRotationProperty; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; + import org.spongepowered.asm.mixin.Mixin; +import darkevilmac.movingworld.common.util.RotationHelper; +import darkevilmac.movingworld.common.util.rotation.IRotationProperty; + @Mixin(PropertyInteger.class) public class MixinPropertyInteger implements IRotationProperty { @Override diff --git a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/entity/MixinEntity.java b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/entity/MixinEntity.java index efc4e956..7f09d4e6 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/entity/MixinEntity.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/entity/MixinEntity.java @@ -1,12 +1,14 @@ package darkevilmac.movingworld.common.asm.mixin.core.entity; -import darkevilmac.movingworld.common.entity.IMixinEntity; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.util.math.BlockPos; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import darkevilmac.movingworld.common.entity.IMixinEntity; + @Mixin(Entity.class) public abstract class MixinEntity implements IMixinEntity { diff --git a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/world/MixinWorld.java b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/world/MixinWorld.java index c652ff6c..a1a1d70f 100644 --- a/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/world/MixinWorld.java +++ b/src/main/java/darkevilmac/movingworld/common/asm/mixin/core/world/MixinWorld.java @@ -1,6 +1,7 @@ package darkevilmac.movingworld.common.asm.mixin.core.world; import net.minecraft.world.World; + import org.spongepowered.asm.mixin.Mixin; @Mixin(World.class) diff --git a/src/main/java/darkevilmac/movingworld/common/block/BlockMovingWorldMarker.java b/src/main/java/darkevilmac/movingworld/common/block/BlockMovingWorldMarker.java index 32b76534..1252ae2e 100644 --- a/src/main/java/darkevilmac/movingworld/common/block/BlockMovingWorldMarker.java +++ b/src/main/java/darkevilmac/movingworld/common/block/BlockMovingWorldMarker.java @@ -1,6 +1,5 @@ package darkevilmac.movingworld.common.block; -import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; @@ -8,10 +7,12 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; + public abstract class BlockMovingWorldMarker extends BlockContainer { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/ChunkCollisionHelper.java b/src/main/java/darkevilmac/movingworld/common/chunk/ChunkCollisionHelper.java index 4f375694..d618f913 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/ChunkCollisionHelper.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/ChunkCollisionHelper.java @@ -1,7 +1,5 @@ package darkevilmac.movingworld.common.chunk; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; -import darkevilmac.movingworld.common.entity.IMixinEntity; import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.block.BlockFenceGate; @@ -18,13 +16,14 @@ import java.util.Iterator; import java.util.List; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; +import darkevilmac.movingworld.common.entity.IMixinEntity; + public class ChunkCollisionHelper { /** * Unimplemented, for colliding with a MobileChunk * - * @param entity - * @param mobileChunk * @return cancel further method. */ public static boolean onEntityMove(Entity entity, MobileChunk mobileChunk, double x, double y, double z) { diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/ChunkIO.java b/src/main/java/darkevilmac/movingworld/common/chunk/ChunkIO.java index 7e329f78..ef1ae8e4 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/ChunkIO.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/ChunkIO.java @@ -1,22 +1,27 @@ package darkevilmac.movingworld.common.chunk; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.buffer.Unpooled; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; -import java.io.*; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; import java.util.Collection; import java.util.Locale; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.buffer.Unpooled; + public abstract class ChunkIO { public static void write(DataOutput out, MobileChunk chunk, Collection blocks) throws IOException { out.writeShort(blocks.size()); diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/MovingWorldAssemblyInteractor.java b/src/main/java/darkevilmac/movingworld/common/chunk/MovingWorldAssemblyInteractor.java index cdbac7cc..4827f740 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/MovingWorldAssemblyInteractor.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/MovingWorldAssemblyInteractor.java @@ -1,11 +1,5 @@ package darkevilmac.movingworld.common.chunk; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.block.BlockMovingWorldMarker; -import darkevilmac.movingworld.common.chunk.assembly.AssembleResult; -import darkevilmac.movingworld.common.chunk.assembly.CanAssemble; -import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; -import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -15,10 +9,16 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.block.BlockMovingWorldMarker; +import darkevilmac.movingworld.common.chunk.assembly.AssembleResult; +import darkevilmac.movingworld.common.chunk.assembly.CanAssemble; +import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; +import io.netty.buffer.ByteBuf; + /** - * Used for storing information given by and taken by the (Dis)Assembler - *

- * Mostly for use in GUIs, the ship pretty much immediately forgets this thing. + * Used for storing information given by and taken by the (Dis)Assembler

Mostly for use in + * GUIs, the ship pretty much immediately forgets this thing. */ public class MovingWorldAssemblyInteractor { @@ -105,8 +105,6 @@ public EnumFacing getFrontDirection(LocatedBlock marker) { /** * Recommended to call writeNBTMetadata first, then write the rest of your data. - * - * @param compound */ public void writeNBTFully(NBTTagCompound compound) { } @@ -114,8 +112,6 @@ public void writeNBTFully(NBTTagCompound compound) { /** * Write metadata to NBT. - * - * @param compound */ public void writeNBTMetadata(NBTTagCompound compound) { } diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/AssembleResult.java b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/AssembleResult.java index 40157482..eb42eaf1 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/AssembleResult.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/AssembleResult.java @@ -24,57 +24,6 @@ public class AssembleResult { - public enum ResultType { - RESULT_NONE, RESULT_OK, RESULT_BLOCK_OVERFLOW, RESULT_MISSING_MARKER, RESULT_ERROR_OCCURED, - RESULT_BUSY_COMPILING, RESULT_INCONSISTENT, RESULT_OK_WITH_WARNINGS; - - public byte toByte() { - return ResultType.toByte(this); - } - - public static byte toByte(ResultType action) { - switch (action) { - case RESULT_OK: - return (byte) 1; - case RESULT_BLOCK_OVERFLOW: - return (byte) 2; - case RESULT_MISSING_MARKER: - return (byte) 3; - case RESULT_ERROR_OCCURED: - return (byte) 4; - case RESULT_BUSY_COMPILING: - return (byte) 5; - case RESULT_INCONSISTENT: - return (byte) 6; - case RESULT_OK_WITH_WARNINGS: - return (byte) 7; - default: - return (byte) 0; - } - } - - public static ResultType fromByte(byte actionInt) { - switch (actionInt) { - case 1: - return RESULT_OK; - case 2: - return RESULT_BLOCK_OVERFLOW; - case 3: - return RESULT_MISSING_MARKER; - case 4: - return RESULT_ERROR_OCCURED; - case 5: - return RESULT_BUSY_COMPILING; - case 6: - return RESULT_INCONSISTENT; - case 7: - return RESULT_OK_WITH_WARNINGS; - default: - return RESULT_NONE; - } - } - } - public final LocatedBlockList assembledBlocks = new LocatedBlockList(); public BlockPos offset; public MovingWorldAssemblyInteractor assemblyInteractor; @@ -83,7 +32,6 @@ public static ResultType fromByte(byte actionInt) { int blockCount; int tileEntityCount; float mass; - public AssembleResult(ResultType resultCode, ByteBuf buf) { this.resultType = resultCode; if (resultCode == ResultType.RESULT_NONE) return; @@ -315,4 +263,55 @@ public ByteBuf toByteBuf(ByteBuf buf) { return buf; } + public enum ResultType { + RESULT_NONE, RESULT_OK, RESULT_BLOCK_OVERFLOW, RESULT_MISSING_MARKER, RESULT_ERROR_OCCURED, + RESULT_BUSY_COMPILING, RESULT_INCONSISTENT, RESULT_OK_WITH_WARNINGS; + + public static byte toByte(ResultType action) { + switch (action) { + case RESULT_OK: + return (byte) 1; + case RESULT_BLOCK_OVERFLOW: + return (byte) 2; + case RESULT_MISSING_MARKER: + return (byte) 3; + case RESULT_ERROR_OCCURED: + return (byte) 4; + case RESULT_BUSY_COMPILING: + return (byte) 5; + case RESULT_INCONSISTENT: + return (byte) 6; + case RESULT_OK_WITH_WARNINGS: + return (byte) 7; + default: + return (byte) 0; + } + } + + public static ResultType fromByte(byte actionInt) { + switch (actionInt) { + case 1: + return RESULT_OK; + case 2: + return RESULT_BLOCK_OVERFLOW; + case 3: + return RESULT_MISSING_MARKER; + case 4: + return RESULT_ERROR_OCCURED; + case 5: + return RESULT_BUSY_COMPILING; + case 6: + return RESULT_INCONSISTENT; + case 7: + return RESULT_OK_WITH_WARNINGS; + default: + return RESULT_NONE; + } + } + + public byte toByte() { + return ResultType.toByte(this); + } + } + } \ No newline at end of file diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkAssembler.java b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkAssembler.java index 17669eb2..31587990 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkAssembler.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkAssembler.java @@ -1,10 +1,5 @@ package darkevilmac.movingworld.common.chunk.assembly; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.LocatedBlock; -import darkevilmac.movingworld.common.chunk.MovingWorldAssemblyInteractor; -import darkevilmac.movingworld.common.chunk.MovingWorldSizeOverflowException; -import darkevilmac.movingworld.common.event.AssembleBlockEvent; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -15,6 +10,12 @@ import java.util.HashSet; import java.util.List; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.LocatedBlock; +import darkevilmac.movingworld.common.chunk.MovingWorldAssemblyInteractor; +import darkevilmac.movingworld.common.chunk.MovingWorldSizeOverflowException; +import darkevilmac.movingworld.common.event.AssembleBlockEvent; + public class ChunkAssembler { public final BlockPos start; diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkDisassembler.java b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkDisassembler.java index 637aabfd..666d1180 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkDisassembler.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/assembly/ChunkDisassembler.java @@ -1,14 +1,5 @@ package darkevilmac.movingworld.common.chunk.assembly; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.LocatedBlock; -import darkevilmac.movingworld.common.chunk.MovingWorldAssemblyInteractor; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; -import darkevilmac.movingworld.common.entity.EntityMovingWorld; -import darkevilmac.movingworld.common.event.DisassembleBlockEvent; -import darkevilmac.movingworld.common.tile.IMovingWorldTileEntity; -import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; -import darkevilmac.movingworld.common.util.*; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; @@ -20,6 +11,20 @@ import java.util.ArrayList; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.LocatedBlock; +import darkevilmac.movingworld.common.chunk.MovingWorldAssemblyInteractor; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; +import darkevilmac.movingworld.common.entity.EntityMovingWorld; +import darkevilmac.movingworld.common.event.DisassembleBlockEvent; +import darkevilmac.movingworld.common.tile.IMovingWorldTileEntity; +import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; +import darkevilmac.movingworld.common.util.FloodFiller; +import darkevilmac.movingworld.common.util.LocatedBlockList; +import darkevilmac.movingworld.common.util.MathHelperMod; +import darkevilmac.movingworld.common.util.RotationHelper; +import darkevilmac.movingworld.common.util.Vec3dMod; + public class ChunkDisassembler { public boolean overwrite; private EntityMovingWorld movingWorld; @@ -113,7 +118,8 @@ public AssembleResult doDisassemble(MovingWorldAssemblyInteractor assemblyIntera blockState = chunk.getBlockState(new BlockPos(i, j, k)); if (blockState.getBlock() == Blocks.AIR) { if (blockState.getBlock().getMetaFromState(blockState) == 1) continue; - } else if (blockState.getBlock().isAir(blockState, world, new BlockPos(i, j, k))) continue; + } else if (blockState.getBlock().isAir(blockState, world, new BlockPos(i, j, k))) + continue; tileentity = chunk.getTileEntity(new BlockPos(i, j, k)); vec = new Vec3dMod(i + ox, j + oy, k + oz); diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkClient.java b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkClient.java index 5d2ab292..a71416a0 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkClient.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkClient.java @@ -1,7 +1,5 @@ package darkevilmac.movingworld.common.chunk.mobilechunk; -import darkevilmac.movingworld.client.render.MobileChunkRenderer; -import darkevilmac.movingworld.common.entity.EntityMovingWorld; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -10,6 +8,9 @@ import java.util.ArrayList; import java.util.List; +import darkevilmac.movingworld.client.render.MobileChunkRenderer; +import darkevilmac.movingworld.common.entity.EntityMovingWorld; + @SideOnly(Side.CLIENT) public class MobileChunkClient extends MobileChunk { private MobileChunkRenderer renderer; diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkServer.java b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkServer.java index f5e8a4bf..6aad4e0a 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkServer.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/MobileChunkServer.java @@ -1,6 +1,5 @@ package darkevilmac.movingworld.common.chunk.mobilechunk; -import darkevilmac.movingworld.common.entity.EntityMovingWorld; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -9,6 +8,8 @@ import java.util.HashSet; import java.util.Set; +import darkevilmac.movingworld.common.entity.EntityMovingWorld; + public class MobileChunkServer extends MobileChunk { private Set sendQueue; diff --git a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/world/FakeWorld.java b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/world/FakeWorld.java index bfa70c7c..a5d1ed3f 100644 --- a/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/world/FakeWorld.java +++ b/src/main/java/darkevilmac/movingworld/common/chunk/mobilechunk/world/FakeWorld.java @@ -1,6 +1,5 @@ package darkevilmac.movingworld.common.chunk.mobilechunk.world; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -10,6 +9,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; + /** * A wrapper for MobileChunks, used to give blocks accurate information about it's neighbors. */ diff --git a/src/main/java/darkevilmac/movingworld/common/config/MainConfig.java b/src/main/java/darkevilmac/movingworld/common/config/MainConfig.java index be14838a..38e3fc46 100644 --- a/src/main/java/darkevilmac/movingworld/common/config/MainConfig.java +++ b/src/main/java/darkevilmac/movingworld/common/config/MainConfig.java @@ -1,8 +1,5 @@ package darkevilmac.movingworld.common.config; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.config.priority.AssemblePriorityConfig; -import darkevilmac.movingworld.common.util.MaterialDensity; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; @@ -19,6 +16,10 @@ import java.util.Set; import java.util.regex.Pattern; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.config.priority.AssemblePriorityConfig; +import darkevilmac.movingworld.common.util.MaterialDensity; + public class MainConfig { private Configuration config; @@ -52,8 +53,6 @@ public Configuration getConfig() { /** * A private method so I can hide it in my IDE, because it's an eye sore. - * - * @return */ private Block[] getDefaultBlockWhiteList() { return new Block[]{Blocks.ACACIA_STAIRS, Blocks.ACTIVATOR_RAIL, Blocks.ANVIL, Blocks.BED, Blocks.BIRCH_STAIRS, Blocks.BOOKSHELF, Blocks.BREWING_STAND, Blocks.BRICK_BLOCK, Blocks.BRICK_STAIRS, Blocks.CACTUS, Blocks.CAKE, Blocks.CARPET, Blocks.COAL_BLOCK, Blocks.COBBLESTONE, Blocks.COBBLESTONE_WALL, Blocks.COMMAND_BLOCK, Blocks.CRAFTING_TABLE, Blocks.DARK_OAK_STAIRS, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DISPENSER, Blocks.DROPPER, Blocks.DAYLIGHT_DETECTOR, Blocks.DOUBLE_STONE_SLAB, Blocks.DOUBLE_WOODEN_SLAB, Blocks.EMERALD_BLOCK, Blocks.ENCHANTING_TABLE, Blocks.END_STONE, Blocks.ENDER_CHEST, Blocks.ACACIA_FENCE, Blocks.BIRCH_FENCE, Blocks.DARK_OAK_FENCE, Blocks.JUNGLE_FENCE, Blocks.NETHER_BRICK_FENCE, Blocks.OAK_FENCE, Blocks.SPRUCE_FENCE, Blocks.ACACIA_FENCE_GATE, Blocks.BIRCH_FENCE_GATE, Blocks.DARK_OAK_FENCE_GATE, Blocks.JUNGLE_FENCE_GATE, Blocks.OAK_FENCE_GATE, Blocks.SPRUCE_FENCE_GATE, Blocks.FLOWER_POT, Blocks.FURNACE, Blocks.FIRE, Blocks.GLASS, Blocks.GLASS_PANE, Blocks.GLOWSTONE, Blocks.GOLD_BLOCK, Blocks.GOLDEN_RAIL, Blocks.HARDENED_CLAY, Blocks.HAY_BLOCK, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, Blocks.HOPPER, Blocks.IRON_BARS, Blocks.IRON_BLOCK, Blocks.IRON_DOOR, Blocks.JUKEBOX, Blocks.JUNGLE_STAIRS, Blocks.LADDER, Blocks.LAPIS_BLOCK, Blocks.LEVER, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, Blocks.LIT_FURNACE, Blocks.LIT_PUMPKIN, Blocks.LIT_REDSTONE_LAMP, Blocks.LOG, Blocks.LOG2, Blocks.MELON_BLOCK, Blocks.MOB_SPAWNER, Blocks.MONSTER_EGG, Blocks.MOSSY_COBBLESTONE, Blocks.NETHER_BRICK, Blocks.NETHER_BRICK_FENCE, Blocks.NETHER_BRICK_STAIRS, Blocks.NOTEBLOCK, Blocks.OAK_STAIRS, Blocks.OBSIDIAN, Blocks.PLANKS, Blocks.PUMPKIN, Blocks.PISTON, Blocks.PISTON_EXTENSION, Blocks.PISTON_HEAD, Blocks.POWERED_COMPARATOR, Blocks.POWERED_REPEATER, Blocks.QUARTZ_BLOCK, Blocks.QUARTZ_STAIRS, Blocks.RAIL, Blocks.REDSTONE_BLOCK, Blocks.REDSTONE_TORCH, Blocks.REDSTONE_WIRE, Blocks.SANDSTONE, Blocks.SANDSTONE_STAIRS, Blocks.RED_SANDSTONE, Blocks.RED_SANDSTONE_STAIRS, Blocks.SKULL, Blocks.SPONGE, Blocks.SPRUCE_STAIRS, Blocks.STAINED_HARDENED_CLAY, Blocks.STANDING_SIGN, Blocks.STONE_BRICK_STAIRS, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE, Blocks.STONE_STAIRS, Blocks.STONEBRICK, Blocks.STAINED_GLASS, Blocks.STAINED_GLASS_PANE, Blocks.STICKY_PISTON, Blocks.STONE_SLAB, Blocks.STONE_SLAB2, Blocks.TNT, Blocks.TORCH, Blocks.TRAPDOOR, Blocks.TRAPPED_CHEST, Blocks.TRIPWIRE, Blocks.TRIPWIRE_HOOK, Blocks.UNLIT_REDSTONE_TORCH, Blocks.UNPOWERED_COMPARATOR, Blocks.UNPOWERED_REPEATER, Blocks.WALL_SIGN, Blocks.WEB, Blocks.WOODEN_BUTTON, Blocks.ACACIA_DOOR, Blocks.BIRCH_DOOR, Blocks.DARK_OAK_DOOR, Blocks.JUNGLE_DOOR, Blocks.OAK_DOOR, Blocks.SPRUCE_DOOR, Blocks.WOODEN_PRESSURE_PLATE, Blocks.WOOL, Blocks.WOODEN_SLAB}; @@ -61,8 +60,6 @@ private Block[] getDefaultBlockWhiteList() { /** * A private method so I can hide it in my IDE, because it's an eye sore. - * - * @return */ private Block[] getDefaultBlockBlackList() { return new Block[]{(Blocks.DIRT), (Blocks.GRASS), (Blocks.SAND), (Blocks.GRAVEL), (Blocks.CLAY), (Blocks.ICE), (Blocks.WATER), (Blocks.FLOWING_WATER), (Blocks.LAVA), (Blocks.FLOWING_LAVA), (Blocks.SNOW), Blocks.SNOW_LAYER, (Blocks.WATERLILY), (Blocks.NETHERRACK), (Blocks.SOUL_SAND), Blocks.TALLGRASS}; diff --git a/src/main/java/darkevilmac/movingworld/common/config/priority/AssemblePriorityConfig.java b/src/main/java/darkevilmac/movingworld/common/config/priority/AssemblePriorityConfig.java index f2ae9504..dbc82728 100644 --- a/src/main/java/darkevilmac/movingworld/common/config/priority/AssemblePriorityConfig.java +++ b/src/main/java/darkevilmac/movingworld/common/config/priority/AssemblePriorityConfig.java @@ -2,12 +2,13 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import darkevilmac.movingworld.MovingWorld; + import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraftforge.common.config.Configuration; + import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; @@ -15,6 +16,8 @@ import java.util.HashSet; import java.util.Set; +import darkevilmac.movingworld.MovingWorld; + public class AssemblePriorityConfig { public static String CONFIG_VERSION = "MovingWorldCFG.1.0.0"; diff --git a/src/main/java/darkevilmac/movingworld/common/entity/EntityMovingWorld.java b/src/main/java/darkevilmac/movingworld/common/entity/EntityMovingWorld.java index 3f9a2945..d2b955d6 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/EntityMovingWorld.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/EntityMovingWorld.java @@ -68,10 +68,6 @@ public abstract class EntityMovingWorld extends EntityBoat implements IEntityAdd public Entity prevRiddenByEntity; protected float groundFriction, horFriction, vertFriction; protected int[] layeredBlockVolumeCount; - private MobileChunk mobileChunk; - private MovingWorldInfo info; - private ChunkDisassembler disassembler; - // Related to actual movement. We don't ever really change these variables, they're changed by classes derived from EntityMovingWorld protected boolean noControl; protected boolean syncPosWithServer; @@ -83,6 +79,9 @@ public abstract class EntityMovingWorld extends EntityBoat implements IEntityAdd protected double controlPitch, controlYaw; @SideOnly(Side.CLIENT) protected double controlVelX, controlVelY, controlVelZ; + private MobileChunk mobileChunk; + private MovingWorldInfo info; + private ChunkDisassembler disassembler; public EntityMovingWorld(World world) { super(world); diff --git a/src/main/java/darkevilmac/movingworld/common/entity/IMixinEntity.java b/src/main/java/darkevilmac/movingworld/common/entity/IMixinEntity.java index 3563298d..d54c230b 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/IMixinEntity.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/IMixinEntity.java @@ -4,7 +4,8 @@ import net.minecraft.util.math.BlockPos; /** - * We have a mixin, we might as well take advantage of it by making some methods accessible with a cast. + * We have a mixin, we might as well take advantage of it by making some methods accessible with a + * cast. */ public interface IMixinEntity { diff --git a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldCapabilities.java b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldCapabilities.java index 4cb36050..bee38e1e 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldCapabilities.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldCapabilities.java @@ -1,11 +1,12 @@ package darkevilmac.movingworld.common.entity; -import darkevilmac.movingworld.common.util.MaterialDensity; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos; +import darkevilmac.movingworld.common.util.MaterialDensity; + public abstract class MovingWorldCapabilities { private final EntityMovingWorld movingWorld; diff --git a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerClient.java b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerClient.java index a3ba9caf..10726a48 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerClient.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerClient.java @@ -1,10 +1,11 @@ package darkevilmac.movingworld.common.entity; -import darkevilmac.movingworld.common.network.MovingWorldNetworking; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHand; +import darkevilmac.movingworld.common.network.MovingWorldNetworking; + public abstract class MovingWorldHandlerClient extends MovingWorldHandlerCommon { public MovingWorldHandlerClient(EntityMovingWorld movingWorld) { super(movingWorld); diff --git a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerCommon.java b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerCommon.java index 6259a941..f6a259f6 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerCommon.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerCommon.java @@ -1,7 +1,5 @@ package darkevilmac.movingworld.common.entity; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -12,6 +10,9 @@ import java.util.HashSet; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; + public abstract class MovingWorldHandlerCommon { public MovingWorldHandlerCommon(EntityMovingWorld entityMovingWorld) { diff --git a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerServer.java b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerServer.java index 91a5a21a..4d5fa29c 100644 --- a/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerServer.java +++ b/src/main/java/darkevilmac/movingworld/common/entity/MovingWorldHandlerServer.java @@ -1,8 +1,5 @@ package darkevilmac.movingworld.common.entity; -import darkevilmac.movingworld.common.chunk.ChunkIO; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkServer; -import darkevilmac.movingworld.common.network.MovingWorldNetworking; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHand; @@ -10,6 +7,10 @@ import java.util.Collection; +import darkevilmac.movingworld.common.chunk.ChunkIO; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkServer; +import darkevilmac.movingworld.common.network.MovingWorldNetworking; + public abstract class MovingWorldHandlerServer extends MovingWorldHandlerCommon { protected boolean firstChunkUpdate; diff --git a/src/main/java/darkevilmac/movingworld/common/event/AssembleBlockEvent.java b/src/main/java/darkevilmac/movingworld/common/event/AssembleBlockEvent.java index d5e0539e..899e35d9 100644 --- a/src/main/java/darkevilmac/movingworld/common/event/AssembleBlockEvent.java +++ b/src/main/java/darkevilmac/movingworld/common/event/AssembleBlockEvent.java @@ -1,8 +1,9 @@ package darkevilmac.movingworld.common.event; -import darkevilmac.movingworld.common.chunk.LocatedBlock; import net.minecraftforge.fml.common.eventhandler.Event; +import darkevilmac.movingworld.common.chunk.LocatedBlock; + /** * Created by DarkEvilMac on 2/22/2015. */ diff --git a/src/main/java/darkevilmac/movingworld/common/event/DisassembleBlockEvent.java b/src/main/java/darkevilmac/movingworld/common/event/DisassembleBlockEvent.java index 9873ba2c..74c1d21c 100644 --- a/src/main/java/darkevilmac/movingworld/common/event/DisassembleBlockEvent.java +++ b/src/main/java/darkevilmac/movingworld/common/event/DisassembleBlockEvent.java @@ -1,8 +1,9 @@ package darkevilmac.movingworld.common.event; -import darkevilmac.movingworld.common.chunk.LocatedBlock; import net.minecraftforge.fml.common.eventhandler.Event; +import darkevilmac.movingworld.common.chunk.LocatedBlock; + public class DisassembleBlockEvent extends Event { public LocatedBlock block; diff --git a/src/main/java/darkevilmac/movingworld/common/mrot/MetaRotations.java b/src/main/java/darkevilmac/movingworld/common/mrot/MetaRotations.java index b06b0e3c..1759847e 100644 --- a/src/main/java/darkevilmac/movingworld/common/mrot/MetaRotations.java +++ b/src/main/java/darkevilmac/movingworld/common/mrot/MetaRotations.java @@ -1,15 +1,25 @@ package darkevilmac.movingworld.common.mrot; -import darkevilmac.movingworld.MovingWorld; import net.minecraft.block.Block; + import org.apache.commons.io.IOUtils; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import darkevilmac.movingworld.MovingWorld; + public class MetaRotations { public Map metaRotationMap; private File metaRotationsDirectory; @@ -125,7 +135,8 @@ public void mrotError(String msg, int lineno) { } public void readMetaRotationFiles() { - if (metaRotationsDirectory == null) throw new NullPointerException("Config folder has not been initialized"); + if (metaRotationsDirectory == null) + throw new NullPointerException("Config folder has not been initialized"); metaRotationMap.clear(); try { diff --git a/src/main/java/darkevilmac/movingworld/common/network/MovingWorldNetworking.java b/src/main/java/darkevilmac/movingworld/common/network/MovingWorldNetworking.java index 72b8f41e..7d6a3cb4 100644 --- a/src/main/java/darkevilmac/movingworld/common/network/MovingWorldNetworking.java +++ b/src/main/java/darkevilmac/movingworld/common/network/MovingWorldNetworking.java @@ -1,13 +1,11 @@ package darkevilmac.movingworld.common.network; -import com.unascribed.lambdanetwork.*; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.ChunkIO; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkClient; -import darkevilmac.movingworld.common.entity.EntityMovingWorld; -import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; +import com.unascribed.lambdanetwork.BiConsumer; +import com.unascribed.lambdanetwork.DataType; +import com.unascribed.lambdanetwork.LambdaNetwork; +import com.unascribed.lambdanetwork.LambdaNetworkBuilder; +import com.unascribed.lambdanetwork.Token; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -22,6 +20,14 @@ import java.io.IOException; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.ChunkIO; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunkClient; +import darkevilmac.movingworld.common.entity.EntityMovingWorld; +import darkevilmac.movingworld.common.tile.TileMovingWorldMarkingBlock; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + public class MovingWorldNetworking { public static LambdaNetwork NETWORK; diff --git a/src/main/java/darkevilmac/movingworld/common/tile/IMovingWorldTileEntity.java b/src/main/java/darkevilmac/movingworld/common/tile/IMovingWorldTileEntity.java index 02eec5ab..aeb45ff5 100644 --- a/src/main/java/darkevilmac/movingworld/common/tile/IMovingWorldTileEntity.java +++ b/src/main/java/darkevilmac/movingworld/common/tile/IMovingWorldTileEntity.java @@ -1,8 +1,9 @@ package darkevilmac.movingworld.common.tile; +import net.minecraft.util.math.BlockPos; + import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; import darkevilmac.movingworld.common.entity.EntityMovingWorld; -import net.minecraft.util.math.BlockPos; public interface IMovingWorldTileEntity { @@ -13,7 +14,8 @@ public interface IMovingWorldTileEntity { void setParentMovingWorld(EntityMovingWorld entityMovingWorld); /** - * Called each tick from the mobilechunk, I advise strongly against any major modifications to the chunk. + * Called each tick from the mobilechunk, I advise strongly against any major modifications to + * the chunk. */ void tick(MobileChunk mobileChunk); diff --git a/src/main/java/darkevilmac/movingworld/common/util/FloodFiller.java b/src/main/java/darkevilmac/movingworld/common/util/FloodFiller.java index ef462262..eec3ac06 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/FloodFiller.java +++ b/src/main/java/darkevilmac/movingworld/common/util/FloodFiller.java @@ -1,7 +1,5 @@ package darkevilmac.movingworld.common.util; -import darkevilmac.movingworld.common.chunk.LocatedBlock; -import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; import net.minecraft.block.BlockAir; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; @@ -9,6 +7,9 @@ import java.util.ArrayList; import java.util.Iterator; +import darkevilmac.movingworld.common.chunk.LocatedBlock; +import darkevilmac.movingworld.common.chunk.mobilechunk.MobileChunk; + /** * Flood fill algorithm for finding if something is water tight. */ diff --git a/src/main/java/darkevilmac/movingworld/common/util/LocatedBlockList.java b/src/main/java/darkevilmac/movingworld/common/util/LocatedBlockList.java index 7d578408..bac9afb8 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/LocatedBlockList.java +++ b/src/main/java/darkevilmac/movingworld/common/util/LocatedBlockList.java @@ -1,12 +1,14 @@ package darkevilmac.movingworld.common.util; import com.google.common.collect.HashBiMap; -import darkevilmac.movingworld.MovingWorld; -import darkevilmac.movingworld.common.chunk.LocatedBlock; + import net.minecraft.util.math.BlockPos; import java.util.ArrayList; +import darkevilmac.movingworld.MovingWorld; +import darkevilmac.movingworld.common.chunk.LocatedBlock; + public class LocatedBlockList extends ArrayList { private HashBiMap posMap; diff --git a/src/main/java/darkevilmac/movingworld/common/util/RotationHelper.java b/src/main/java/darkevilmac/movingworld/common/util/RotationHelper.java index 9db4c0ef..2fd9f3a7 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/RotationHelper.java +++ b/src/main/java/darkevilmac/movingworld/common/util/RotationHelper.java @@ -1,13 +1,14 @@ package darkevilmac.movingworld.common.util; -import darkevilmac.movingworld.common.chunk.LocatedBlock; -import darkevilmac.movingworld.common.util.rotation.IRotationBlock; -import darkevilmac.movingworld.common.util.rotation.IRotationProperty; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.Vec3i; +import darkevilmac.movingworld.common.chunk.LocatedBlock; +import darkevilmac.movingworld.common.util.rotation.IRotationBlock; +import darkevilmac.movingworld.common.util.rotation.IRotationProperty; + public class RotationHelper { public static LocatedBlock rotateBlock(LocatedBlock locatedBlock, boolean ccw) { diff --git a/src/main/java/darkevilmac/movingworld/common/util/Vec3dMod.java b/src/main/java/darkevilmac/movingworld/common/util/Vec3dMod.java index 46127dec..856278e5 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/Vec3dMod.java +++ b/src/main/java/darkevilmac/movingworld/common/util/Vec3dMod.java @@ -45,9 +45,6 @@ public Vec3dMod makeNewVec(double x, double y, double z) { /** * Rotate around the X axis - * - * @param pitch - * @return */ @Deprecated public Vec3dMod rotatePitch(float pitch) { @@ -56,9 +53,6 @@ public Vec3dMod rotatePitch(float pitch) { /** * Rotate around the Y axis - * - * @param yaw - * @return */ @Deprecated public Vec3dMod rotateYaw(float yaw) { @@ -67,9 +61,6 @@ public Vec3dMod rotateYaw(float yaw) { /** * Rotate around the Z axis. - * - * @param roll - * @return */ @Deprecated public Vec3dMod rotateRoll(float roll) { diff --git a/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationBlock.java b/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationBlock.java index a8edbfea..c9ac4c41 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationBlock.java +++ b/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationBlock.java @@ -4,8 +4,8 @@ /** - * The same as IRotationProperty but applies if you're using one of Minecraft's properties that aren't designed for rotation - * like the banner's rotation integer. + * The same as IRotationProperty but applies if you're using one of Minecraft's properties that + * aren't designed for rotation like the banner's rotation integer. */ public interface IRotationBlock { diff --git a/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationProperty.java b/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationProperty.java index acdcfdac..a4358afe 100644 --- a/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationProperty.java +++ b/src/main/java/darkevilmac/movingworld/common/util/rotation/IRotationProperty.java @@ -3,8 +3,9 @@ import net.minecraft.block.state.IBlockState; /** - * If a block is for whatever reason not using one of the pre-made rotation systems Minecraft provides they can make - * their custom property extend this so MovingWorld will know how to rotate it. + * If a block is for whatever reason not using one of the pre-made rotation systems Minecraft + * provides they can make their custom property extend this so MovingWorld will know how to rotate + * it. */ public interface IRotationProperty { diff --git a/src/main/java/darkevilmac/movingworld/common/world/MobileWorld.java b/src/main/java/darkevilmac/movingworld/common/world/MobileWorld.java index 88201cf1..2b50c219 100644 --- a/src/main/java/darkevilmac/movingworld/common/world/MobileWorld.java +++ b/src/main/java/darkevilmac/movingworld/common/world/MobileWorld.java @@ -14,7 +14,8 @@ import java.io.File; /** - * NO IMPLEMENTATION, WORK IN PROGRESS DO NOT EXPECT IN THE NEAR FUTURE FOR THIS TO BE COMPLETE, THE SAME APPLIES TO THE NEW MOBILECHUNK CLASS + * NO IMPLEMENTATION, WORK IN PROGRESS DO NOT EXPECT IN THE NEAR FUTURE FOR THIS TO BE COMPLETE, THE + * SAME APPLIES TO THE NEW MOBILECHUNK CLASS */ public class MobileWorld extends World {