diff --git a/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java b/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java index e0eca6aed..a71d5f296 100644 --- a/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java +++ b/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java @@ -8,7 +8,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 04/03/2016. @@ -26,6 +26,9 @@ public class ClientPartModelBakery new ModelResourceLocation("techreborn:cable#type=" + type.getName().toLowerCase()), new RenderCablePart(type)); } + event.getModelRegistry().putObject( + new ModelResourceLocation("techreborn:fluidpipe"), + new RenderFluidPipePart()); } @SubscribeEvent @@ -35,6 +38,7 @@ public class ClientPartModelBakery { event.getMap().registerSprite(new ResourceLocation(type.textureName)); } + event.getMap().registerSprite(new ResourceLocation("techreborn:blocks/fluidPipes/fluidpipe")); } } diff --git a/src/main/java/techreborn/client/render/parts/RenderCablePart.java b/src/main/java/techreborn/client/render/parts/RenderCablePart.java index ec7fafad7..2f3736e80 100644 --- a/src/main/java/techreborn/client/render/parts/RenderCablePart.java +++ b/src/main/java/techreborn/client/render/parts/RenderCablePart.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.common.property.IExtendedBlockState; import org.lwjgl.util.vector.Vector3f; import reborncore.common.misc.vecmath.Vecs3dCube; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/techreborn/client/render/parts/RenderFluidPipePart.java b/src/main/java/techreborn/client/render/parts/RenderFluidPipePart.java new file mode 100644 index 000000000..83cf24774 --- /dev/null +++ b/src/main/java/techreborn/client/render/parts/RenderFluidPipePart.java @@ -0,0 +1,136 @@ +package techreborn.client.render.parts; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.*; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.property.IExtendedBlockState; +import org.lwjgl.util.vector.Vector3f; +import reborncore.common.misc.vecmath.Vecs3dCube; +import techreborn.parts.fluidPipes.MultipartFluidPipe; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by modmuss50 on 09/05/2016. + */ +public class RenderFluidPipePart implements IBakedModel { + + private FaceBakery faceBakery = new FaceBakery(); + private TextureAtlasSprite texture; + + public RenderFluidPipePart() { + texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("techreborn:blocks/fluidPipes/fluidpipe"); + } + + public void addCubeToList(Vecs3dCube cube, ArrayList<BakedQuad> list, BlockPartFace face, + ModelRotation modelRotation, TextureAtlasSprite cubeTexture, EnumFacing dir) { + BlockFaceUV uv = new BlockFaceUV(new float[]{(float) cube.getMinX(), (float) cube.getMinY(), + (float) cube.getMaxX(), (float) cube.getMaxY()}, 0); + face = new BlockPartFace(null, 0, "", uv); + if (dir == EnumFacing.NORTH || dir == EnumFacing.SOUTH) { + uv = new BlockFaceUV(new float[]{(float) cube.getMinZ(), (float) cube.getMinY(), + (float) cube.getMaxZ(), (float) cube.getMaxY()}, 0); + face = new BlockPartFace(null, 0, "", uv); + } + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.DOWN, modelRotation, null, true, true));// down + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.UP, modelRotation, null, true, true));// up + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.NORTH, modelRotation, null, true, true));// north + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMaxZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.SOUTH, modelRotation, null, true, true));// south + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.EAST, modelRotation, null, true, true));// east + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.WEST, modelRotation, null, true, true));// west + } + + @Override + public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand) { + ArrayList<BakedQuad> list = new ArrayList<>(); + BlockFaceUV uv = new BlockFaceUV(new float[]{0.0F, 0.0F, 16.0F, 16.0F}, 0); + BlockPartFace face = new BlockPartFace(null, 0, "", uv); + double thickness = MultipartFluidPipe.thickness; + double lastThickness = 16 - thickness; + IExtendedBlockState state = (IExtendedBlockState) blockState; + if (side != null) { + return Collections.emptyList(); + } + addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness), + list, face, ModelRotation.X0_Y0, texture, null); + if (state != null) { + if (state.getValue(MultipartFluidPipe.UP)) { + addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness), + list, face, ModelRotation.X0_Y0, texture, EnumFacing.UP); + } + if (state.getValue(MultipartFluidPipe.DOWN)) { + addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list, + face, ModelRotation.X0_Y0, texture, EnumFacing.DOWN); + } + if (state.getValue(MultipartFluidPipe.NORTH)) { + addCubeToList(new Vecs3dCube(thickness, thickness, 0.0, lastThickness, lastThickness, thickness), list, + face, ModelRotation.X0_Y0, texture, EnumFacing.NORTH); + } + if (state.getValue(MultipartFluidPipe.SOUTH)) { + addCubeToList(new Vecs3dCube(thickness, thickness, lastThickness, lastThickness, lastThickness, 16.0), + list, face, ModelRotation.X0_Y0, texture, EnumFacing.SOUTH); + } + if (state.getValue(MultipartFluidPipe.EAST)) { + addCubeToList(new Vecs3dCube(lastThickness, thickness, thickness, 16.0, lastThickness, lastThickness), + list, face, ModelRotation.X0_Y0, texture, EnumFacing.EAST); + } + if (state.getValue(MultipartFluidPipe.WEST)) { + addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list, + face, ModelRotation.X0_Y0, texture, EnumFacing.WEST); + } + } + return list; + } + + @Override + public boolean isAmbientOcclusion() { + return true; + } + + @Override + public boolean isGui3d() { + return true; + } + + @Override + public boolean isBuiltInRenderer() { + return false; + } + + @Override + public TextureAtlasSprite getParticleTexture() { + return texture; + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } + + @Override + public ItemOverrideList getOverrides() { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 1cba0f47d..9e46c4625 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -24,7 +24,7 @@ import techreborn.api.recipe.machines.*; import techreborn.blocks.*; import techreborn.config.ConfigTechReborn; import techreborn.items.*; -import techreborn.parts.ItemStandaloneCables; +import techreborn.parts.powerCables.ItemStandaloneCables; import techreborn.utils.RecipeUtils; import techreborn.utils.StackWIPHandler; diff --git a/src/main/java/techreborn/init/RecipeCompact.java b/src/main/java/techreborn/init/RecipeCompact.java index 7527d457a..03fcf875d 100644 --- a/src/main/java/techreborn/init/RecipeCompact.java +++ b/src/main/java/techreborn/init/RecipeCompact.java @@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.IRecipeCompact; import techreborn.blocks.BlockMachineFrame; import techreborn.items.*; -import techreborn.parts.ItemStandaloneCables; +import techreborn.parts.powerCables.ItemStandaloneCables; import java.io.BufferedWriter; import java.io.File; diff --git a/src/main/java/techreborn/parts/StandalonePartCompact.java b/src/main/java/techreborn/parts/StandalonePartCompact.java index 663353230..6cad9f330 100644 --- a/src/main/java/techreborn/parts/StandalonePartCompact.java +++ b/src/main/java/techreborn/parts/StandalonePartCompact.java @@ -6,6 +6,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import techreborn.compat.ICompatModule; +import techreborn.parts.powerCables.ItemStandaloneCables; /** * Created by modmuss50 on 06/03/2016. diff --git a/src/main/java/techreborn/parts/TechRebornParts.java b/src/main/java/techreborn/parts/TechRebornParts.java index fe0a2eaa2..a2d30cbae 100644 --- a/src/main/java/techreborn/parts/TechRebornParts.java +++ b/src/main/java/techreborn/parts/TechRebornParts.java @@ -12,6 +12,11 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import techreborn.compat.ICompatModule; +import techreborn.parts.fluidPipes.ItemFluidPipe; +import techreborn.parts.fluidPipes.MultipartFluidPipe; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; +import techreborn.parts.powerCables.ItemCables; /** * Created by modmuss50 on 02/03/2016. @@ -22,6 +27,9 @@ public class TechRebornParts implements ICompatModule @Nullable public static Item cables; + @Nullable + public static Item fluidPipe; + public static HashMap<EnumCableType, Class<? extends CableMultipart>> multipartHashMap = new HashMap<>(); @Override @@ -39,7 +47,13 @@ public class TechRebornParts implements ICompatModule MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name()); } cables = new ItemCables(); - GameRegistry.registerItem(cables, "cables"); + cables.setRegistryName("cables"); + GameRegistry.register(cables); + + MultipartRegistry.registerPart(MultipartFluidPipe.class, "techreborn:fluidpipe"); + fluidPipe = new ItemFluidPipe(); + fluidPipe.setRegistryName("fluidPipe"); + GameRegistry.register(fluidPipe); } @Override diff --git a/src/main/java/techreborn/parts/fluidPipes/ItemFluidPipe.java b/src/main/java/techreborn/parts/fluidPipes/ItemFluidPipe.java new file mode 100644 index 000000000..e66e7f561 --- /dev/null +++ b/src/main/java/techreborn/parts/fluidPipes/ItemFluidPipe.java @@ -0,0 +1,29 @@ +package techreborn.parts.fluidPipes; + +import mcmultipart.item.ItemMultiPart; +import mcmultipart.multipart.IMultipart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import reborncore.RebornCore; +import techreborn.client.TechRebornCreativeTab; + +/** + * Created by modmuss50 on 09/05/2016. + */ +public class ItemFluidPipe extends ItemMultiPart { + + public ItemFluidPipe() { + setCreativeTab(TechRebornCreativeTab.instance); + setUnlocalizedName("techreborn.fluidpipe"); + RebornCore.jsonDestroyer.registerObject(this); + } + + @Override + public IMultipart createPart(World world, BlockPos pos, EnumFacing side, Vec3d hit, ItemStack stack, EntityPlayer player) { + return new MultipartFluidPipe(); + } +} diff --git a/src/main/java/techreborn/parts/fluidPipes/MultipartFluidPipe.java b/src/main/java/techreborn/parts/fluidPipes/MultipartFluidPipe.java new file mode 100644 index 000000000..cf7b6dc37 --- /dev/null +++ b/src/main/java/techreborn/parts/fluidPipes/MultipartFluidPipe.java @@ -0,0 +1,282 @@ +package techreborn.parts.fluidPipes; + +import mcmultipart.MCMultiPartMod; +import mcmultipart.microblock.IMicroblock; +import mcmultipart.multipart.*; +import mcmultipart.raytrace.PartMOP; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.common.property.Properties; +import reborncore.api.power.IEnergyInterfaceTile; +import reborncore.common.misc.Functions; +import reborncore.common.misc.vecmath.Vecs3dCube; +import reborncore.common.util.WorldUtils; +import techreborn.parts.TechRebornParts; + +import java.util.*; + +/** + * Created by modmuss50 on 09/05/2016. + */ +public class MultipartFluidPipe extends Multipart implements INormallyOccludingPart, ISlottedPart, ITickable { + + public static final IUnlistedProperty<Boolean> UP = Properties.toUnlisted(PropertyBool.create("up")); + public static final IUnlistedProperty<Boolean> DOWN = Properties.toUnlisted(PropertyBool.create("down")); + public static final IUnlistedProperty<Boolean> NORTH = Properties.toUnlisted(PropertyBool.create("north")); + public static final IUnlistedProperty<Boolean> EAST = Properties.toUnlisted(PropertyBool.create("east")); + public static final IUnlistedProperty<Boolean> SOUTH = Properties.toUnlisted(PropertyBool.create("south")); + public static final IUnlistedProperty<Boolean> WEST = Properties.toUnlisted(PropertyBool.create("west")); + public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14]; + public float center = 0.6F; + public float offset = 0.10F; + public Map<EnumFacing, BlockPos> connectedSides; + public static final int thickness = 12; + + public MultipartFluidPipe() { + connectedSides = new HashMap<>(); + refreshBounding(); + } + + public static MultipartFluidPipe getPartFromWorld(World world, BlockPos pos, EnumFacing side) { + if (world == null || pos == null) { + return null; + } + IMultipartContainer container = MultipartHelper.getPartContainer(world, pos); + if (side != null && container != null) { + ISlottedPart slottedPart = container.getPartInSlot(PartSlot.getFaceSlot(side)); + if (slottedPart instanceof IMicroblock.IFaceMicroblock + && !((IMicroblock.IFaceMicroblock) slottedPart).isFaceHollow()) { + return null; + } + } + + if (container == null) { + return null; + } + ISlottedPart part = container.getPartInSlot(PartSlot.CENTER); + if (part instanceof MultipartFluidPipe) { + return (MultipartFluidPipe) part; + } + return null; + } + + public void refreshBounding() { + float centerFirst = center - offset; + double w = (thickness / 16) - 0.5; + boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w, centerFirst - w, centerFirst + w, + centerFirst + w, centerFirst + w); + + int i = 0; + for (EnumFacing dir : EnumFacing.VALUES) { + double xMin1 = (dir.getFrontOffsetX() < 0 ? 0.0 + : (dir.getFrontOffsetX() == 0 ? centerFirst - w : centerFirst + w)); + double xMax1 = (dir.getFrontOffsetX() > 0 ? 1.0 + : (dir.getFrontOffsetX() == 0 ? centerFirst + w : centerFirst - w)); + + double yMin1 = (dir.getFrontOffsetY() < 0 ? 0.0 + : (dir.getFrontOffsetY() == 0 ? centerFirst - w : centerFirst + w)); + double yMax1 = (dir.getFrontOffsetY() > 0 ? 1.0 + : (dir.getFrontOffsetY() == 0 ? centerFirst + w : centerFirst - w)); + + double zMin1 = (dir.getFrontOffsetZ() < 0 ? 0.0 + : (dir.getFrontOffsetZ() == 0 ? centerFirst - w : centerFirst + w)); + double zMax1 = (dir.getFrontOffsetZ() > 0 ? 1.0 + : (dir.getFrontOffsetZ() == 0 ? centerFirst + w : centerFirst - w)); + + boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1, yMax1, zMax1); + i++; + } + } + + @Override + public void addCollisionBoxes(AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity) { + + for (EnumFacing dir : EnumFacing.VALUES) { + if (connectedSides.containsKey(dir) + && mask.intersectsWith(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + if (mask.intersectsWith(boundingBoxes[6].toAABB())) { + list.add(boundingBoxes[6].toAABB()); + } + super.addCollisionBoxes(mask, list, collidingEntity); + } + + @Override + public void addSelectionBoxes(List<AxisAlignedBB> list) { + + for (EnumFacing dir : EnumFacing.VALUES) { + if (connectedSides.containsKey(dir)) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + list.add(boundingBoxes[6].toAABB()); + super.addSelectionBoxes(list); + } + + @Override + public void onRemoved() { + super.onRemoved(); + for (EnumFacing dir : EnumFacing.VALUES) { + MultipartFluidPipe multipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); + if (multipart != null) { + multipart.nearByChange(); + } + } + } + + @Override + public void addOcclusionBoxes(List<AxisAlignedBB> list) { + for (EnumFacing dir : EnumFacing.VALUES) { + if (connectedSides.containsKey(dir)) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + list.add(boundingBoxes[6].toAABB()); + } + + @Override + public void onNeighborBlockChange(Block block) { + super.onNeighborBlockChange(block); + nearByChange(); + + } + + public void nearByChange() { + checkConnectedSides(); + for (EnumFacing direction : EnumFacing.VALUES) { + BlockPos blockPos = getPos().offset(direction); + WorldUtils.updateBlock(getWorld(), blockPos); + MultipartFluidPipe part = getPartFromWorld(getWorld(), blockPos, direction); + if (part != null) { + part.checkConnectedSides(); + } + } + } + + @Override + public void onAdded() { + nearByChange(); + } + + public boolean shouldConnectTo(EnumFacing dir) { + if (dir != null) { + if (internalShouldConnectTo(dir)) { + MultipartFluidPipe multipartFluidPipe = getPartFromWorld(getWorld(), getPos().offset(dir), dir); + if (multipartFluidPipe != null && multipartFluidPipe.internalShouldConnectTo(dir.getOpposite())) { + return true; + } + } else { + TileEntity tile = getNeighbourTile(dir); + + if (tile instanceof IEnergyInterfaceTile) { + return true; + } + } + } + return false; + } + + public boolean internalShouldConnectTo(EnumFacing dir) { + ISlottedPart part = getContainer().getPartInSlot(PartSlot.getFaceSlot(dir)); + if (part instanceof IMicroblock.IFaceMicroblock) { + if (!((IMicroblock.IFaceMicroblock) part).isFaceHollow()) { + return false; + } + } + + if (!OcclusionHelper.occlusionTest(getContainer().getParts(), p -> p == this, boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) { + return false; + } + + MultipartFluidPipe multipartFluidPipe = getPartFromWorld(getWorld(), getPos().offset(dir), dir.getOpposite()); + + return multipartFluidPipe != null; + } + + public TileEntity getNeighbourTile(EnumFacing side) { + return side != null ? getWorld().getTileEntity(getPos().offset(side)) : null; + } + + public void checkConnectedSides() { + refreshBounding(); + connectedSides = new HashMap<>(); + for (EnumFacing dir : EnumFacing.values()) { + int d = Functions.getIntDirFromDirection(dir); + if (getWorld() == null) { + return; + } + TileEntity te = getNeighbourTile(dir); + if (shouldConnectTo(dir)) { + connectedSides.put(dir, te.getPos()); + } + } + } + + @Override + public EnumSet<PartSlot> getSlotMask() { + return EnumSet.of(PartSlot.CENTER); + } + + @Override + public IBlockState getExtendedState(IBlockState state) { + IExtendedBlockState extendedBlockState = (IExtendedBlockState) state; + return extendedBlockState.withProperty(DOWN, shouldConnectTo(EnumFacing.DOWN)) + .withProperty(UP, shouldConnectTo(EnumFacing.UP)).withProperty(NORTH, shouldConnectTo(EnumFacing.NORTH)) + .withProperty(SOUTH, shouldConnectTo(EnumFacing.SOUTH)) + .withProperty(WEST, shouldConnectTo(EnumFacing.WEST)) + .withProperty(EAST, shouldConnectTo(EnumFacing.EAST)); + } + + @Override + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(MCMultiPartMod.multipart, new IProperty[]{}, + new IUnlistedProperty[]{DOWN, UP, NORTH, SOUTH, WEST, EAST}); + } + + @Override + public float getHardness(PartMOP hit) { + return 0.5F; + } + + public Material getMaterial() { + return Material.CLOTH; + } + + @Override + public List<ItemStack> getDrops() { + List<ItemStack> list = new ArrayList<>(); + list.add(new ItemStack(TechRebornParts.fluidPipe, 1, 0)); + return list; + } + + @Override + public ResourceLocation getModelPath() { + return new ResourceLocation("techreborn:fluidpipe"); + } + + @Override + public boolean canRenderInLayer(BlockRenderLayer layer) { + return layer == BlockRenderLayer.CUTOUT; + } + + @Override + public void update() { + + } +} diff --git a/src/main/java/techreborn/parts/CableMultipart.java b/src/main/java/techreborn/parts/powerCables/CableMultipart.java similarity index 99% rename from src/main/java/techreborn/parts/CableMultipart.java rename to src/main/java/techreborn/parts/powerCables/CableMultipart.java index deede2248..8cb55fd1b 100644 --- a/src/main/java/techreborn/parts/CableMultipart.java +++ b/src/main/java/techreborn/parts/powerCables/CableMultipart.java @@ -1,4 +1,4 @@ -package techreborn.parts; +package techreborn.parts.powerCables; import mcmultipart.MCMultiPartMod; import mcmultipart.microblock.IMicroblock; @@ -31,6 +31,7 @@ import reborncore.common.misc.vecmath.Vecs3dCube; import reborncore.common.util.WorldUtils; import techreborn.config.ConfigTechReborn; import techreborn.init.ModSounds; +import techreborn.parts.TechRebornParts; import techreborn.parts.walia.IPartWaliaProvider; import techreborn.power.TRPowerNet; import techreborn.utils.damageSources.ElectrialShockSource; diff --git a/src/main/java/techreborn/parts/EnumCableType.java b/src/main/java/techreborn/parts/powerCables/EnumCableType.java similarity index 79% rename from src/main/java/techreborn/parts/EnumCableType.java rename to src/main/java/techreborn/parts/powerCables/EnumCableType.java index 4266220a3..53249e381 100644 --- a/src/main/java/techreborn/parts/EnumCableType.java +++ b/src/main/java/techreborn/parts/powerCables/EnumCableType.java @@ -1,15 +1,15 @@ -package techreborn.parts; +package techreborn.parts.powerCables; import net.minecraft.util.IStringSerializable; import reborncore.api.power.EnumPowerTier; -import techreborn.parts.types.CopperCable; -import techreborn.parts.types.GlassFiberCable; -import techreborn.parts.types.GoldCable; -import techreborn.parts.types.HVCable; -import techreborn.parts.types.InsulatedCopperCable; -import techreborn.parts.types.InsulatedGoldCable; -import techreborn.parts.types.InsulatedHVCable; -import techreborn.parts.types.TinCable; +import techreborn.parts.powerCables.types.CopperCable; +import techreborn.parts.powerCables.types.GlassFiberCable; +import techreborn.parts.powerCables.types.GoldCable; +import techreborn.parts.powerCables.types.HVCable; +import techreborn.parts.powerCables.types.InsulatedCopperCable; +import techreborn.parts.powerCables.types.InsulatedGoldCable; +import techreborn.parts.powerCables.types.InsulatedHVCable; +import techreborn.parts.powerCables.types.TinCable; public enum EnumCableType implements IStringSerializable { diff --git a/src/main/java/techreborn/parts/EnumStandaloneCableType.java b/src/main/java/techreborn/parts/powerCables/EnumStandaloneCableType.java similarity index 97% rename from src/main/java/techreborn/parts/EnumStandaloneCableType.java rename to src/main/java/techreborn/parts/powerCables/EnumStandaloneCableType.java index 4bfa71bd5..c81258ce4 100644 --- a/src/main/java/techreborn/parts/EnumStandaloneCableType.java +++ b/src/main/java/techreborn/parts/powerCables/EnumStandaloneCableType.java @@ -1,4 +1,4 @@ -package techreborn.parts; +package techreborn.parts.powerCables; import net.minecraft.util.IStringSerializable; import reborncore.api.power.EnumPowerTier; diff --git a/src/main/java/techreborn/parts/ICableType.java b/src/main/java/techreborn/parts/powerCables/ICableType.java similarity index 74% rename from src/main/java/techreborn/parts/ICableType.java rename to src/main/java/techreborn/parts/powerCables/ICableType.java index 451999d6e..30888d929 100644 --- a/src/main/java/techreborn/parts/ICableType.java +++ b/src/main/java/techreborn/parts/powerCables/ICableType.java @@ -1,4 +1,4 @@ -package techreborn.parts; +package techreborn.parts.powerCables; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/ItemCables.java b/src/main/java/techreborn/parts/powerCables/ItemCables.java similarity index 97% rename from src/main/java/techreborn/parts/ItemCables.java rename to src/main/java/techreborn/parts/powerCables/ItemCables.java index 1d3f99424..1619d7d2d 100644 --- a/src/main/java/techreborn/parts/ItemCables.java +++ b/src/main/java/techreborn/parts/powerCables/ItemCables.java @@ -1,4 +1,4 @@ -package techreborn.parts; +package techreborn.parts.powerCables; import java.util.List; @@ -21,6 +21,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; +import techreborn.parts.TechRebornParts; /** * Created by modmuss50 on 27/02/2016. diff --git a/src/main/java/techreborn/parts/ItemStandaloneCables.java b/src/main/java/techreborn/parts/powerCables/ItemStandaloneCables.java similarity index 97% rename from src/main/java/techreborn/parts/ItemStandaloneCables.java rename to src/main/java/techreborn/parts/powerCables/ItemStandaloneCables.java index 5413fcefe..77fa15ba9 100644 --- a/src/main/java/techreborn/parts/ItemStandaloneCables.java +++ b/src/main/java/techreborn/parts/powerCables/ItemStandaloneCables.java @@ -1,4 +1,4 @@ -package techreborn.parts; +package techreborn.parts.powerCables; import java.security.InvalidParameterException; import java.util.List; @@ -12,6 +12,7 @@ import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTab; import techreborn.items.ItemTextureBase; import techreborn.lib.ModInfo; +import techreborn.parts.StandalonePartCompact; /** * Created by modmuss50 on 06/03/2016. diff --git a/src/main/java/techreborn/parts/types/CopperCable.java b/src/main/java/techreborn/parts/powerCables/types/CopperCable.java similarity index 55% rename from src/main/java/techreborn/parts/types/CopperCable.java rename to src/main/java/techreborn/parts/powerCables/types/CopperCable.java index b0608923e..cfe94cc26 100644 --- a/src/main/java/techreborn/parts/types/CopperCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/CopperCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/GlassFiberCable.java b/src/main/java/techreborn/parts/powerCables/types/GlassFiberCable.java similarity index 56% rename from src/main/java/techreborn/parts/types/GlassFiberCable.java rename to src/main/java/techreborn/parts/powerCables/types/GlassFiberCable.java index 77c29d595..419fab761 100644 --- a/src/main/java/techreborn/parts/types/GlassFiberCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/GlassFiberCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/GoldCable.java b/src/main/java/techreborn/parts/powerCables/types/GoldCable.java similarity index 55% rename from src/main/java/techreborn/parts/types/GoldCable.java rename to src/main/java/techreborn/parts/powerCables/types/GoldCable.java index a7ad7c2b5..adbf73f1b 100644 --- a/src/main/java/techreborn/parts/types/GoldCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/GoldCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/HVCable.java b/src/main/java/techreborn/parts/powerCables/types/HVCable.java similarity index 54% rename from src/main/java/techreborn/parts/types/HVCable.java rename to src/main/java/techreborn/parts/powerCables/types/HVCable.java index 9a4974d3a..1cdcd5a6d 100644 --- a/src/main/java/techreborn/parts/types/HVCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/HVCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/InsulatedCopperCable.java b/src/main/java/techreborn/parts/powerCables/types/InsulatedCopperCable.java similarity index 57% rename from src/main/java/techreborn/parts/types/InsulatedCopperCable.java rename to src/main/java/techreborn/parts/powerCables/types/InsulatedCopperCable.java index b06be64cc..79e658f9f 100644 --- a/src/main/java/techreborn/parts/types/InsulatedCopperCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/InsulatedCopperCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/InsulatedGoldCable.java b/src/main/java/techreborn/parts/powerCables/types/InsulatedGoldCable.java similarity index 56% rename from src/main/java/techreborn/parts/types/InsulatedGoldCable.java rename to src/main/java/techreborn/parts/powerCables/types/InsulatedGoldCable.java index c33ec6368..afaaaa37d 100644 --- a/src/main/java/techreborn/parts/types/InsulatedGoldCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/InsulatedGoldCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/InsulatedHVCable.java b/src/main/java/techreborn/parts/powerCables/types/InsulatedHVCable.java similarity index 56% rename from src/main/java/techreborn/parts/types/InsulatedHVCable.java rename to src/main/java/techreborn/parts/powerCables/types/InsulatedHVCable.java index a8cebde02..73d8603fb 100644 --- a/src/main/java/techreborn/parts/types/InsulatedHVCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/InsulatedHVCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/types/TinCable.java b/src/main/java/techreborn/parts/powerCables/types/TinCable.java similarity index 55% rename from src/main/java/techreborn/parts/types/TinCable.java rename to src/main/java/techreborn/parts/powerCables/types/TinCable.java index ea0133c49..780eee3ca 100644 --- a/src/main/java/techreborn/parts/types/TinCable.java +++ b/src/main/java/techreborn/parts/powerCables/types/TinCable.java @@ -1,7 +1,7 @@ -package techreborn.parts.types; +package techreborn.parts.powerCables.types; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; /** * Created by modmuss50 on 05/03/2016. diff --git a/src/main/java/techreborn/parts/walia/WaliaPartProvider.java b/src/main/java/techreborn/parts/walia/WaliaPartProvider.java index 2cf5882a2..d08bd502f 100644 --- a/src/main/java/techreborn/parts/walia/WaliaPartProvider.java +++ b/src/main/java/techreborn/parts/walia/WaliaPartProvider.java @@ -18,7 +18,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import techreborn.parts.CableMultipart; +import techreborn.parts.powerCables.CableMultipart; /** * Created by modmuss50 on 07/03/2016. diff --git a/src/main/java/techreborn/power/TRPowerNet.java b/src/main/java/techreborn/power/TRPowerNet.java index ea0820a11..c77382cc9 100644 --- a/src/main/java/techreborn/power/TRPowerNet.java +++ b/src/main/java/techreborn/power/TRPowerNet.java @@ -10,8 +10,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import reborncore.api.power.IEnergyInterfaceTile; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; +import techreborn.parts.powerCables.CableMultipart; +import techreborn.parts.powerCables.EnumCableType; public class TRPowerNet { diff --git a/src/main/resources/assets/techreborn/textures/blocks/fluidPipes/fluidpipe.png b/src/main/resources/assets/techreborn/textures/blocks/fluidPipes/fluidpipe.png new file mode 100644 index 000000000..d4428e0de Binary files /dev/null and b/src/main/resources/assets/techreborn/textures/blocks/fluidPipes/fluidpipe.png differ