diff --git a/gradle.properties b/gradle.properties index 69a55d6f..d9a452ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,16 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.1-pre1a +bta_version=7.1-pre2a # Loader loader_version=0.15.6-babric.4-bta # Mods -halplibe_version=3.4.13 -modmenu_version=2.0.3 +halplibe_version=3.4.17 +modmenu_version=2.0.4 dragonfly_version=1.4.4-7.1 -btwaila_version=1.0.7-7.1 +btwaila_version=1.0.9-7.1 terrain_api_version=1.4.2-7.1 # Mod diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 3f1ee9e2..0420db1c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -14,7 +14,6 @@ import net.minecraft.client.render.entity.MobRenderer; import net.minecraft.client.render.entity.SnowballRenderer; import net.minecraft.client.render.model.ModelZombie; -import net.minecraft.client.sound.block.BlockSounds; import net.minecraft.core.block.*; import net.minecraft.core.block.material.Material; import net.minecraft.core.block.tag.BlockTags; @@ -27,6 +26,7 @@ import net.minecraft.core.item.tool.ItemToolPickaxe; import net.minecraft.core.player.inventory.Container; import net.minecraft.core.player.inventory.IInventory; +import net.minecraft.core.sound.BlockSounds; import net.minecraft.core.world.Dimension; import net.minecraft.core.world.World; import net.minecraft.core.world.biome.Biome; @@ -54,6 +54,7 @@ import sunsetsatellite.signalindustries.blocks.states.ConduitStateInterpreter; import sunsetsatellite.signalindustries.blocks.states.EEPROMProgrammerStateInterpreter; import sunsetsatellite.signalindustries.blocks.states.ItemConduitStateInterpreter; +import sunsetsatellite.signalindustries.commands.RecipeReloadCommand; import sunsetsatellite.signalindustries.dim.WorldTypeEternity; import sunsetsatellite.signalindustries.entities.EntityCrystal; import sunsetsatellite.signalindustries.entities.EntityEnergyOrb; @@ -434,6 +435,22 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { ) .build(new BlockFluidConduit("reinforced.conduit.fluid",config.getInt("BlockIDs.reinforcedFluidConduit"),Tier.REINFORCED,Material.glass)); + public static final Block prototypeItemConduit = new BlockBuilder(MOD_ID) + .setTextures("item_conduit_prototype.png") + .setLuminance(0) + .setResistance(1) + .setHardness(1) + .setBlockSound(BlockSounds.GLASS) + .setBlockModel( + new BlockModelDragonFly( + ModelHelper.getOrCreateBlockModel(MOD_ID,"conduit/item/prototype/conduit_all.json"), + ModelHelper.getOrCreateBlockState(MOD_ID,"prototype_item_conduit.json"), + new ItemConduitStateInterpreter(), + true + ) + ) + .build(new BlockItemConduit("prototype.conduit.item",config.getInt("BlockIDs.prototypeItemConduit"),Tier.PROTOTYPE,Material.glass, PipeType.NORMAL)); + public static final Block basicItemConduit = new BlockBuilder(MOD_ID) .setTextures("item_conduit_basic.png") .setLuminance(0) @@ -448,7 +465,23 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { true ) ) - .build(new BlockItemConduit("basic.conduit.item",config.getInt("BlockIDs.basicItemConduit"),Tier.BASIC,Material.glass)); + .build(new BlockItemConduit("basic.conduit.item",config.getInt("BlockIDs.basicItemConduit"),Tier.BASIC,Material.glass, PipeType.NORMAL)); + + public static final Block basicRestrictItemConduit = new BlockBuilder(MOD_ID) + .setTextures("item_conduit_basic.png") + .setLuminance(0) + .setResistance(1) + .setHardness(1) + .setBlockSound(BlockSounds.GLASS) + .setBlockModel( + new BlockModelDragonFly( + ModelHelper.getOrCreateBlockModel(MOD_ID,"conduit/item/basic/restrict/conduit_all.json"), + ModelHelper.getOrCreateBlockState(MOD_ID,"basic_item_conduit_restrict.json"), + new ItemConduitStateInterpreter(), + true + ) + ) + .build(new BlockItemConduit("basic.conduit.item.restrict",config.getInt("BlockIDs.basicRestrictItemConduit"),Tier.BASIC,Material.glass, PipeType.RESTRICT)); public static final Block infiniteEnergyCell = new BlockBuilder(MOD_ID) @@ -724,6 +757,18 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { .setNorthTexture("basic_inserter_input.png") .build(new BlockInserter("basic.inserter",config.getInt("BlockIDs.basicInserter"),Tier.BASIC,Material.metal)); + public static final Block prototypeFilter = new BlockBuilder(MOD_ID) + .setHardness(1) + .setResistance(3) + .setBlockSound(BlockSounds.STONE) + .setTopTexture("filter_red.png") + .setNorthTexture("filter_green.png") + .setEastTexture("filter_blue.png") + .setWestTexture("filter_yellow.png") + .setSouthTexture("filter_magenta.png") + .setBottomTexture("filter_cyan.png") + .build(new BlockFilter("prototype.filter",config.getInt("BlockIDs.prototypeFilter"),Tier.PROTOTYPE,Material.stone)); + public static final int[][] breakerTex = new int[][]{TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_2.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_2_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"inserteroutput.png")}; public static final Block basicAutomaticMiner = new BlockBuilder(MOD_ID) .setBlockSound(BlockSounds.METAL) @@ -740,6 +785,13 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { .setTextures("external_io_blank.png") .build(new BlockExternalIO("basic.externalIO",config.getInt("BlockIDs.externalIo"),Tier.BASIC,Material.metal)); + public static final Block reinforcedExternalIo = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.METAL) + .setHardness(1) + .setResistance(3) + .setTextures("reinforced_external_io_blank.png") + .build(new BlockExternalIO("reinforced.externalIO",config.getInt("BlockIDs.reinforcedExternalIo"),Tier.REINFORCED,Material.metal)); + public static final Block reinforcedCentrifuge = new BlockBuilder(MOD_ID) .setBlockSound(BlockSounds.METAL) .setHardness(1) @@ -844,6 +896,30 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { .setTextures(1,0) .build(new BlockProgrammer("basic.programmer",config.getInt("BlockIDs.basicProgrammer"),Tier.BASIC,Material.metal)); + public static final Block cobblestoneBricks = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.STONE) + .setHardness(1) + .setResistance(3) + .setLuminance(0) + .setTextures("cobblestone_bricks.png") + .build(new Block("prototype.bricks",config.getInt("BlockIDs.cobblestoneBricks"),Material.stone)); + + public static final Block crystalAlloyBricks = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.METAL) + .setHardness(1) + .setResistance(3) + .setLuminance(0) + .setTextures("crystal_alloy_bricks.png") + .build(new Block("basic.bricks",config.getInt("BlockIDs.crystalAlloyBricks"),Material.metal)); + + public static final Block reinforcedCrystalAlloyBricks = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.METAL) + .setHardness(1) + .setResistance(3) + .setLuminance(0) + .setTextures("reinforced_alloy_bricks.png") + .build(new Block("reinforced.bricks",config.getInt("BlockIDs.reinforcedCrystalAlloyBricks"),Material.metal)); + //this has to be after any other block public static final int[] energyTex = TextureHelper.getOrCreateBlockTexture(MOD_ID,"signalum_energy_transparent.png"); public static final int[] burntSignalumTex = TextureHelper.getOrCreateBlockTexture(MOD_ID,"burnt_signalum.png");//registerFluidTexture(MOD_ID,"signalum_energy.png",0,4); @@ -1061,6 +1137,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { public static final Item blankAbilityModule = simpleItem("blankAbilityModule","blank_module.png"); public static final Item abilityContainerCasing = simpleItem("abilityContainerCasing","abilitycontainercasing.png"); public static final Item blankChip = simpleItem("blankChip","romChip.blank","blank_chip.png"); + public static final Item positionMemoryChip = ItemHelper.createItem(MOD_ID,new ItemPositionChip("romChip.position",config.getInt("ItemIDs.positionMemoryChip")),"position_chip.png"); public static final int[] energyOrbTex = TextureHelper.getOrCreateItemTexture(MOD_ID,"energyorb.png"); @@ -1071,7 +1148,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { public static final AchievementPage ACHIEVEMENTS = new SignalIndustriesAchievementPage(); - public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome().setFillerBlock(realityFabric.id).setTopBlock(realityFabric.id).setColor(0x808080)); + public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome("signalindustries:eternity").setFillerBlock(realityFabric.id).setTopBlock(realityFabric.id).setColor(0x808080)); public static final WorldType eternityWorld = WorldTypes.register("signalindustries:eternity",new WorldTypeEternity(key("eternity"))); public static final Dimension dimEternity = new Dimension(key("eternity"),Dimension.overworld,1,portalEternity.id).setDefaultWorldType(eternityWorld); @@ -1159,6 +1236,8 @@ public void onInitialize() { textures.put(Tier.BASIC.name()+".inserter.vertical",new BlockTexture(MOD_ID).setAll("basic_blank.png").setBottomTexture("basic_inserter_output.png").setTopTexture("basic_inserter_input.png")); textures.put(Tier.BASIC.name()+".externalIo",new BlockTexture(MOD_ID).setAll("external_io_blank.png").setTopTexture("external_io_input.png").setBottomTexture("external_io_output.png").setNorthTexture("external_io_both.png")); + textures.put(Tier.REINFORCED.name()+".externalIo",new BlockTexture(MOD_ID).setAll("reinforced_external_io_blank.png").setTopTexture("reinforced_external_io_input.png").setBottomTexture("reinforced_external_io_output.png").setNorthTexture("reinforced_external_io_both.png")); + textures.put(Tier.REINFORCED.name()+".centrifuge.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setTopTexture("reinforced_centrifuge_closed.png").setNorthTexture("reinforced_centrifuge_front_active.png")); textures.put(Tier.REINFORCED.name()+".centrifuge.active.overlay",new BlockTexture(MOD_ID).setNorthTexture("centrifuge_overlay.png")); @@ -1218,6 +1297,7 @@ public SignalIndustries(){ ironPlateHammer.setContainerItem(ironPlateHammer); CommandHelper.Core.createCommand(new NBTEditCommand()); + CommandHelper.Core.createCommand(new RecipeReloadCommand("recipes")); CommandHelper.Core.createCommand(new StructureCommand("structure","struct")); EntityHelper.Core.createEntity(EntityCrystal.class,47,"signalumCrystal"); @@ -1307,6 +1387,9 @@ public SignalIndustries(){ EntityHelper.Core.createTileEntity(TileEntityProgrammer.class,"EEPROM Programmer"); addToNameGuiMap("EEPROM Programmer", GuiProgrammer.class,TileEntityProgrammer.class); + EntityHelper.Core.createTileEntity(TileEntityFilter.class,"Filter"); + addToNameGuiMap("Filter", GuiFilter.class, TileEntityFilter.class); + EntityHelper.Core.createTileEntity(TileEntityUVLamp.class,"Ultraviolet Lamp"); addToNameGuiMap("The Pulsar", GuiPulsar.class, InventoryPulsar.class); @@ -1355,7 +1438,6 @@ public static Item simpleItem(String name, String lang, String texture){ return ItemHelper.createItem(MOD_ID,new Item(lang,config.getInt("ItemIDs."+name)),texture); } - public static void displayGui(EntityPlayer entityplayer, GuiScreen guiScreen, Container container, IInventory tile, int x, int y, int z) { if(entityplayer instanceof EntityPlayerMP) { ((IEntityPlayerMP)entityplayer).displayGuiScreen_si(guiScreen,container,tile,x,y,z); diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java index 9ee45a1e..23d7bc88 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java @@ -51,18 +51,34 @@ public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side si int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; Connection connection = tile.itemConnections.get(Direction.getDirectionFromSide(side.getId())); - if(connection == Connection.INPUT){ - int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_input.png"); - return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); - } else if(connection == Connection.OUTPUT){ - int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_output.png"); - return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); - } else if(connection == Connection.BOTH){ - int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_both.png"); - return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + if(tier == Tier.REINFORCED){ + if(connection == Connection.INPUT){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_input.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(connection == Connection.OUTPUT){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_output.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(connection == Connection.BOTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_both.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_blank.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } } else { - int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_blank.png"); - return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + if(connection == Connection.INPUT){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_input.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(connection == Connection.OUTPUT){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_output.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(connection == Connection.BOTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_both.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_blank.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java new file mode 100644 index 00000000..2b0d2854 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java @@ -0,0 +1,83 @@ +package sunsetsatellite.signalindustries.blocks; + +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.block.entity.TileEntityChest; +import net.minecraft.core.block.material.Material; +import net.minecraft.core.entity.EntityItem; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.world.World; +import sunsetsatellite.catalyst.core.util.Direction; +import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidPipe; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered; +import sunsetsatellite.signalindustries.containers.ContainerCrusher; +import sunsetsatellite.signalindustries.containers.ContainerFilter; +import sunsetsatellite.signalindustries.gui.GuiCrusher; +import sunsetsatellite.signalindustries.gui.GuiFilter; +import sunsetsatellite.signalindustries.inventories.TileEntityFilter; +import sunsetsatellite.signalindustries.inventories.machines.TileEntityCrusher; +import sunsetsatellite.signalindustries.util.Tier; + +import java.util.ArrayList; +import java.util.Random; + +public class BlockFilter extends BlockContainerTiered { + public BlockFilter(String key, int i, Tier tier, Material material) { + super(key, i, tier, material); + } + + @Override + public void onBlockRemoved(World world, int i, int j, int k, int data) { + TileEntityFilter tile = (TileEntityFilter) world.getBlockTileEntity(i, j, k); + if (tile != null) { + Random random = new Random(); + for (int l = 0; l < tile.getSizeInventory(); ++l) { + ItemStack itemstack = tile.getStackInSlot(l); + if (itemstack != null) { + float f = random.nextFloat() * 0.8F + 0.1F; + float f1 = random.nextFloat() * 0.8F + 0.1F; + float f2 = random.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) { + int i1 = random.nextInt(21) + 10; + if (i1 > itemstack.stackSize) { + i1 = itemstack.stackSize; + } + + itemstack.stackSize -= i1; + EntityItem entityitem = new EntityItem(world, (float) i + f, (float) j + f1, (float) k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getMetadata())); + float f3 = 0.05F; + entityitem.xd = (float) random.nextGaussian() * f3; + entityitem.yd = (float) random.nextGaussian() * f3 + 0.2F; + entityitem.zd = (float) random.nextGaussian() * f3; + world.entityJoinedWorld(entityitem); + } + } + } + } + + super.onBlockRemoved(world, i, j, k, data); + } + + @Override + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) + { + if(world.isClientSide) + { + return true; + } else + { + TileEntityFilter tile = (TileEntityFilter) world.getBlockTileEntity(i, j, k); + if(tile != null) { + SignalIndustries.displayGui(entityplayer,new GuiFilter(entityplayer.inventory, tile),new ContainerFilter(entityplayer.inventory,tile),tile,i,j,k); + } + return true; + } + } + + @Override + protected TileEntity getNewBlockEntity() { + return new TileEntityFilter(); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java index b14b19bb..3844ffac 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java @@ -10,10 +10,14 @@ import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.world.World; import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidPipe; +import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered; +import sunsetsatellite.signalindustries.gui.GuiFluidIOConfig; +import sunsetsatellite.signalindustries.gui.GuiRestrictPipeConfig; import sunsetsatellite.signalindustries.inventories.TileEntityConduit; import sunsetsatellite.signalindustries.inventories.TileEntityItemConduit; import sunsetsatellite.signalindustries.util.PipeMode; +import sunsetsatellite.signalindustries.util.PipeType; import sunsetsatellite.signalindustries.util.Tier; import java.util.List; @@ -22,8 +26,11 @@ public class BlockItemConduit extends BlockContainerTiered { - public BlockItemConduit(String key, int i, Tier tier, Material material) { + public PipeType type; + + public BlockItemConduit(String key, int i, Tier tier, Material material, PipeType type) { super(key, i, tier, material); + this.type = type; } protected TileEntity getNewBlockEntity() { @@ -36,10 +43,16 @@ public boolean isSolidRender() { @Override public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { - if (entityplayer.isSneaking() && !world.isClientSide) { + if (entityplayer.isSneaking() && type == PipeType.NORMAL && !world.isClientSide) { TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k); tile.mode = PipeMode.values()[tile.mode.ordinal()+1 <= PipeMode.values().length-1 ? tile.mode.ordinal()+1 : 0]; Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Pipe mode changed to: "+tile.mode); + return true; + } + if (!world.isClientSide && type == PipeType.RESTRICT) { + TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k); + SignalIndustries.displayGui(entityplayer, new GuiRestrictPipeConfig(entityplayer, tile, null), tile, tile.x,tile.y,tile.z); + return true; } return false; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/states/ItemConduitStateInterpreter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/states/ItemConduitStateInterpreter.java index 493d7840..e54bff32 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/states/ItemConduitStateInterpreter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/states/ItemConduitStateInterpreter.java @@ -11,6 +11,8 @@ import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.blocks.BlockConduit; import sunsetsatellite.signalindustries.blocks.BlockFluidConduit; +import sunsetsatellite.signalindustries.inventories.TileEntityInserter; +import sunsetsatellite.signalindustries.inventories.TileEntityItemConduit; import useless.dragonfly.model.blockstates.processed.MetaStateInterpreter; import java.util.HashMap; @@ -19,6 +21,7 @@ public class ItemConduitStateInterpreter extends MetaStateInterpreter { @Override public HashMap getStateMap(WorldSource worldSource, int i, int j, int k, Block block, int meta) { HashMap states = new HashMap<>(); + TileEntityItemConduit tile = (TileEntityItemConduit) worldSource.getBlockTileEntity(i,j,k); for (Direction direction : Direction.values()) { boolean show = false; Vec3i offset = new Vec3i(i,j,k).add(direction.getVec()); @@ -40,6 +43,9 @@ public HashMap getStateMap(WorldSource worldSource, int i, int j } } states.put(direction.getName().toLowerCase(), String.valueOf(show)); + if(tile != null){ + states.put("restrict_"+direction.getName().toLowerCase(), String.valueOf(tile.restrictDirections.get(direction))); + } } return states; } diff --git a/src/main/java/sunsetsatellite/signalindustries/commands/RecipeReloadCommand.java b/src/main/java/sunsetsatellite/signalindustries/commands/RecipeReloadCommand.java new file mode 100644 index 00000000..f3e0bb9b --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/commands/RecipeReloadCommand.java @@ -0,0 +1,114 @@ +package sunsetsatellite.signalindustries.commands; + +import net.minecraft.client.Minecraft; +import net.minecraft.core.block.Block; +import net.minecraft.core.crafting.legacy.CraftingManager; +import net.minecraft.core.data.DataLoader; +import net.minecraft.core.data.registry.Registries; +import net.minecraft.core.data.registry.Registry; +import net.minecraft.core.data.registry.recipe.RecipeEntryBase; +import net.minecraft.core.data.registry.recipe.RecipeRegistry; +import net.minecraft.core.data.registry.recipe.entry.*; +import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.net.command.Command; +import net.minecraft.core.net.command.CommandHandler; +import net.minecraft.core.net.command.CommandSender; +import sunsetsatellite.signalindustries.recipes.container.SIRecipes; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; + +import static net.minecraft.core.data.registry.Registries.*; + +public class RecipeReloadCommand extends Command { + public RecipeReloadCommand(String name, String... alts) { + super(name, alts); + } + + @Override + public boolean execute(CommandHandler commandHandler, CommandSender commandSender, String[] strings) { + if(strings.length == 1 && Objects.equals(strings[0], "reload")){ + Registries.RECIPES = new RecipeRegistry(); + List> list = new ArrayList<>(); + List>> list2 = new ArrayList<>(); + RECIPE_TYPES.forEach(list2::add); + ITEM_GROUPS.forEach(list::add); + list.forEach((L)->{ + String key = ITEM_GROUPS.getKey(L); + ITEM_GROUPS.unregister(key); + }); + list2.forEach((C)->{ + String key = RECIPE_TYPES.getKey(C); + RECIPE_TYPES.unregister(key); + }); + readdVanillaRegistryItems(); + CraftingManager.getInstance().reset(); + CraftingManager.getInstance().init(); + DataLoader.loadRecipesFromFile("/recipes/blast_furnace.json"); + DataLoader.loadRecipesFromFile("/recipes/furnace.json"); + DataLoader.loadRecipesFromFile("/recipes/trommel.json"); + DataLoader.loadRecipesFromFile("/recipes/workbench.json"); + SIRecipes.resetGroups(); + SIRecipes.load(); + DataLoader.loadDataPacks(Minecraft.getMinecraft(this)); + RECIPES_LOCAL_COPY = RECIPES; + int recipes = RECIPES.getAllRecipes().size(); + int groups = RECIPES.getAllGroups().size(); + int namespaces = RECIPES.size(); + int itemGroups = ITEM_GROUPS.size(); + commandSender.sendMessage(String.format("%d item groups.",itemGroups)); + commandSender.sendMessage(String.format("%d recipes in %d groups in %d namespaces.",recipes,groups,namespaces)); + commandSender.sendMessage("Recipes reloaded!"); + return true; + } + return false; + } + + private void readdVanillaRegistryItems(){ + RECIPE_TYPES.register("minecraft:crafting/shaped", RecipeEntryCraftingShaped.class); + RECIPE_TYPES.register("minecraft:crafting/shapeless", RecipeEntryCraftingShapeless.class); + RECIPE_TYPES.register("minecraft:crafting/label", RecipeEntryLabel.class); + RECIPE_TYPES.register("minecraft:crafting/label_dye", RecipeEntryLabelDye.class); + RECIPE_TYPES.register("minecraft:crafting/scrap", RecipeEntryScrap.class); + RECIPE_TYPES.register("minecraft:crafting/repairable", RecipeEntryRepairable.class); + RECIPE_TYPES.register("minecraft:crafting/repairable_stackable", RecipeEntryRepairableStackable.class); + RECIPE_TYPES.register("minecraft:crafting/uses_tool", RecipeEntryCraftingWithTool.class); + RECIPE_TYPES.register("minecraft:smelting", RecipeEntryFurnace.class); + RECIPE_TYPES.register("minecraft:smelting/blast", RecipeEntryBlastFurnace.class); + RECIPE_TYPES.register("minecraft:trommeling", RecipeEntryTrommel.class); + + ITEM_GROUPS.register("minecraft:stones",stackListOf(Block.stone, Block.basalt, Block.limestone, Block.granite)); + ITEM_GROUPS.register("minecraft:cobblestones",stackListOf(Block.cobbleStone, Block.cobbleBasalt, Block.cobbleLimestone, Block.cobbleGranite, Block.cobblePermafrost)); + ITEM_GROUPS.register("minecraft:planks",stackListOf(Block.planksOak, new ItemStack(Block.planksOakPainted, 1, 0), new ItemStack(Block.planksOakPainted, 1, 1), new ItemStack(Block.planksOakPainted, 1, 2), new ItemStack(Block.planksOakPainted, 1, 3), new ItemStack(Block.planksOakPainted, 1, 4), new ItemStack(Block.planksOakPainted, 1, 5), new ItemStack(Block.planksOakPainted, 1, 6), new ItemStack(Block.planksOakPainted, 1, 7), new ItemStack(Block.planksOakPainted, 1, 8), new ItemStack(Block.planksOakPainted, 1, 9), new ItemStack(Block.planksOakPainted, 1, 10), new ItemStack(Block.planksOakPainted, 1, 11), new ItemStack(Block.planksOakPainted, 1, 12), new ItemStack(Block.planksOakPainted, 1, 13), new ItemStack(Block.planksOakPainted, 1, 14), new ItemStack(Block.planksOakPainted, 1, 15))); + ITEM_GROUPS.register("minecraft:grasses",stackListOf(Block.grass, Block.grassRetro)); + ITEM_GROUPS.register("minecraft:dirt",stackListOf(Block.dirt, Block.dirtScorched)); + ITEM_GROUPS.register("minecraft:trommel_dirt",stackListOf(Block.dirt, Block.dirtScorched, Block.grass, Block.grassRetro, Block.grassScorched, Block.pathDirt, Block.farmlandDirt)); + ITEM_GROUPS.register("minecraft:moss_stones",stackListOf(Block.mossStone, Block.mossBasalt, Block.mossLimestone, Block.mossGranite)); + ITEM_GROUPS.register("minecraft:logs",stackListOf(Block.logOak, Block.logPine, Block.logBirch, Block.logCherry, Block.logEucalyptus, Block.logOakMossy)); + ITEM_GROUPS.register("minecraft:leaves",stackListOf(Block.leavesOak, Block.leavesOakRetro, Block.leavesPine, Block.leavesBirch, Block.leavesCherry, Block.leavesEucalyptus, Block.leavesShrub)); + ITEM_GROUPS.register("minecraft:coal_ores",stackListOf(Block.oreCoalStone, Block.oreCoalBasalt, Block.oreCoalLimestone, Block.oreCoalGranite)); + ITEM_GROUPS.register("minecraft:iron_ores",stackListOf(Block.oreIronStone, Block.oreIronBasalt, Block.oreIronLimestone, Block.oreIronGranite)); + ITEM_GROUPS.register("minecraft:gold_ores",stackListOf(Block.oreGoldStone, Block.oreGoldBasalt, Block.oreGoldLimestone, Block.oreGoldGranite)); + ITEM_GROUPS.register("minecraft:lapis_ores",stackListOf(Block.oreLapisStone, Block.oreLapisBasalt, Block.oreLapisLimestone, Block.oreLapisGranite)); + ITEM_GROUPS.register("minecraft:redstone_ores",stackListOf(Block.oreRedstoneStone, Block.oreRedstoneBasalt, Block.oreRedstoneLimestone, Block.oreRedstoneGranite, Block.oreRedstoneGlowingStone, Block.oreRedstoneGlowingBasalt, Block.oreRedstoneGlowingLimestone, Block.oreRedstoneGlowingGranite)); + ITEM_GROUPS.register("minecraft:diamond_ores",stackListOf(Block.oreDiamondStone, Block.oreDiamondBasalt, Block.oreDiamondLimestone, Block.oreDiamondGranite)); + ITEM_GROUPS.register("minecraft:nethercoal_ores", stackListOf(Block.oreNethercoalNetherrack)); + ITEM_GROUPS.register("minecraft:chests",stackListOf(Block.chestPlanksOak, new ItemStack(Block.chestPlanksOakPainted, 1, 0x00), new ItemStack(Block.chestPlanksOakPainted, 1, 0x10), new ItemStack(Block.chestPlanksOakPainted, 1, 0x20), new ItemStack(Block.chestPlanksOakPainted, 1, 0x30), new ItemStack(Block.chestPlanksOakPainted, 1, 0x40), new ItemStack(Block.chestPlanksOakPainted, 1, 0x50), new ItemStack(Block.chestPlanksOakPainted, 1, 0x60), new ItemStack(Block.chestPlanksOakPainted, 1, 0x70), new ItemStack(Block.chestPlanksOakPainted, 1, 0x80), new ItemStack(Block.chestPlanksOakPainted, 1, 0x90), new ItemStack(Block.chestPlanksOakPainted, 1, 0xA0), new ItemStack(Block.chestPlanksOakPainted, 1, 0xB0), new ItemStack(Block.chestPlanksOakPainted, 1, 0xC0), new ItemStack(Block.chestPlanksOakPainted, 1, 0xD0), new ItemStack(Block.chestPlanksOakPainted, 1, 0xE0), new ItemStack(Block.chestPlanksOakPainted, 1, 0xF0))); + ITEM_GROUPS.register("minecraft:wools", stackListOf(new ItemStack(Block.wool, 1, 0), new ItemStack(Block.wool, 1, 1), new ItemStack(Block.wool, 1, 2), new ItemStack(Block.wool, 1, 3), new ItemStack(Block.wool, 1, 4), new ItemStack(Block.wool, 1, 5), new ItemStack(Block.wool, 1, 6), new ItemStack(Block.wool, 1, 7), new ItemStack(Block.wool, 1, 8), new ItemStack(Block.wool, 1, 9), new ItemStack(Block.wool, 1, 10), new ItemStack(Block.wool, 1, 11), new ItemStack(Block.wool, 1, 12), new ItemStack(Block.wool, 1, 13), new ItemStack(Block.wool, 1, 14), new ItemStack(Block.wool, 1, 15))); + ITEM_GROUPS.register("minecraft:lamps", stackListOf(new ItemStack(Block.lampIdle, 1, 0), new ItemStack(Block.lampIdle, 1, 1), new ItemStack(Block.lampIdle, 1, 2), new ItemStack(Block.lampIdle, 1, 3), new ItemStack(Block.lampIdle, 1, 4), new ItemStack(Block.lampIdle, 1, 5), new ItemStack(Block.lampIdle, 1, 6), new ItemStack(Block.lampIdle, 1, 7), new ItemStack(Block.lampIdle, 1, 8), new ItemStack(Block.lampIdle, 1, 9), new ItemStack(Block.lampIdle, 1, 10), new ItemStack(Block.lampIdle, 1, 11), new ItemStack(Block.lampIdle, 1, 12), new ItemStack(Block.lampIdle, 1, 13), new ItemStack(Block.lampIdle, 1, 14), new ItemStack(Block.lampIdle, 1, 15))); + + } + + @Override + public boolean opRequired(String[] strings) { + return true; + } + + @Override + public void sendCommandSyntax(CommandHandler commandHandler, CommandSender commandSender) { + commandSender.sendMessage("/recipes reload"); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/containers/ContainerFilter.java b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerFilter.java new file mode 100644 index 00000000..abb84e7e --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerFilter.java @@ -0,0 +1,54 @@ +package sunsetsatellite.signalindustries.containers; + +import net.minecraft.core.InventoryAction; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.player.inventory.Container; +import net.minecraft.core.player.inventory.IInventory; +import net.minecraft.core.player.inventory.slot.Slot; +import sunsetsatellite.signalindustries.inventories.TileEntityFilter; + +import java.util.List; + +public class ContainerFilter extends Container { + private final TileEntityFilter tile; + + public ContainerFilter(IInventory iinventory, TileEntityFilter tileEntity) { + this.tile = tileEntity; + int numberOfRows = 6; + int i = (numberOfRows - 4) * 18; + int l; + int j1; + for(l = 0; l < numberOfRows; ++l) { + for(j1 = 0; j1 < 9; ++j1) { + this.addSlot(new Slot(tileEntity, j1 + l * 9, 8 + j1 * 18, 18 + l * 18)); + } + } + + for(l = 0; l < 3; ++l) { + for(j1 = 0; j1 < 9; ++j1) { + this.addSlot(new Slot(iinventory, j1 + l * 9 + 9, 8 + j1 * 18, 115 + l * 18 + i)); + } + } + + for(l = 0; l < 9; ++l) { + this.addSlot(new Slot(iinventory, l, 8 + l * 18, 173 + i)); + } + + } + + @Override + public List getMoveSlots(InventoryAction inventoryAction, Slot slot, int i, EntityPlayer entityPlayer) { + return null; + } + + @Override + public List getTargetSlots(InventoryAction inventoryAction, Slot slot, int i, EntityPlayer entityPlayer) { + return null; + } + + @Override + public boolean isUsableByPlayer(EntityPlayer entityPlayer) { + return tile.canInteractWith(entityPlayer); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java b/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java index c7e89246..e0a78687 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java @@ -204,7 +204,7 @@ public void tick() { } } - world.playSoundAtEntity(this, "signalindustries.crystalbreak", 0.5F, 1F / (this.random.nextFloat() * 0.4F + 0.8F)); + world.playSoundAtEntity(this, this,"signalindustries.crystalbreak", 0.5F, 1F / (this.random.nextFloat() * 0.4F + 0.8F)); this.remove(); } @@ -276,7 +276,7 @@ public void readAdditionalSaveData(CompoundTag tag) { public void playerTouch(EntityPlayer player) { if (this.inGroundSnowball && this.thrower == player && this.shakeSnowball <= 0) { - this.world.playSoundAtEntity(this, "random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F); + this.world.playSoundAtEntity(this, this,"random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F); player.onItemPickup(this, 1); this.remove(); } diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/EntityEnergyOrb.java b/src/main/java/sunsetsatellite/signalindustries/entities/EntityEnergyOrb.java index e8e6f810..335aff3b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/EntityEnergyOrb.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/EntityEnergyOrb.java @@ -195,7 +195,7 @@ public void tick() { if (this.isOnFire()) { movingobjectposition.entity.fireHurt(); } - this.world.playSoundAtEntity(this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); + this.world.playSoundAtEntity(this, this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); this.remove(); } else { this.remove(); @@ -260,7 +260,7 @@ public void tick() { } protected void inGroundAction() { - this.world.playSoundAtEntity(this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); + this.world.playSoundAtEntity(this, this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); this.inGround = true; this.arrowShake = 7; } diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/EntitySunbeam.java b/src/main/java/sunsetsatellite/signalindustries/entities/EntitySunbeam.java index 78230d37..cbf031d5 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/EntitySunbeam.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/EntitySunbeam.java @@ -191,7 +191,7 @@ public void tick() { if (this.isOnFire()) { movingobjectposition.entity.fireHurt(); } - this.world.playSoundAtEntity(this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); + this.world.playSoundAtEntity(this, this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); this.remove(); } else { this.remove(); @@ -256,7 +256,7 @@ public void tick() { } protected void inGroundAction() { - this.world.playSoundAtEntity(this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); + this.world.playSoundAtEntity(this, this, "random.drr", 1.0f, 1.2f / (this.random.nextFloat() * 0.2f + 0.9f)); this.inGround = true; this.arrowShake = 7; } diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java index 44f61b3f..3bdffed9 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java @@ -57,7 +57,7 @@ public void doExplosionA() { } public void doExplosionB(boolean particles, float red, float green, float blue) { - this.world.playSoundAtEntity(exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); + this.world.playSoundAtEntity(exploder, exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); List arraylist = new ArrayList<>(this.destroyedBlockPositions); for (int i = arraylist.size() - 1; i >= 0; i--) { ChunkPosition chunkposition = arraylist.get(i); @@ -88,7 +88,7 @@ public void doExplosionB(boolean particles, float red, float green, float blue) public void doExplosionB(boolean particles) { if(exploder != null){ - this.world.playSoundAtEntity(exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); + this.world.playSoundAtEntity(exploder, exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); } List arraylist = new ArrayList<>(this.destroyedBlockPositions); diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionNoDrops.java b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionNoDrops.java index 84a8b888..46ceea8b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionNoDrops.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionNoDrops.java @@ -62,7 +62,7 @@ public void doExplosionA() { public void doExplosionB(boolean particles) { if(exploder != null){ - this.world.playSoundAtEntity(exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); + this.world.playSoundAtEntity(exploder, exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); } List arraylist = new ArrayList<>(); arraylist.addAll(this.destroyedBlockPositions); diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/mob/EntityInfernal.java b/src/main/java/sunsetsatellite/signalindustries/entities/mob/EntityInfernal.java index b237b7c1..1ec9a52b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/mob/EntityInfernal.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/mob/EntityInfernal.java @@ -17,10 +17,9 @@ public EntityInfernal(World world) { this.moveSpeed = 0.5F; this.attackStrength = 5; this.scoreValue = 1000; - this.health = 40; this.fireImmune = true; + this.setHealthRaw(40); } - private int beamsLaunched = 0; private int beamCooldown = 0; private DamageType lastDamageType = null; @@ -66,7 +65,7 @@ protected void attackEntity(Entity entity, float distance) entityarrow.y += 0.3999999761581421D; double d2 = (entity.y + (double) entity.getHeadHeight()) - 0.20000000298023224D - entityarrow.y; float f1 = MathHelper.sqrt_double(d * d + d1 * d1) * 0.2F; - world.playSoundAtEntity(this, "random.bow", 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F)); + world.playSoundAtEntity(this, this, "random.bow", 1.0F, 1.0F / (random.nextFloat() * 0.4F + 0.8F)); world.entityJoinedWorld(entityarrow); entityarrow.setArrowHeading(d, d2, d1, 0.6F, 12F); beamsLaunched++; @@ -96,6 +95,11 @@ public boolean hurt(Entity attacker, int i, DamageType type) { return super.hurt(attacker, i, type); } + @Override + public int getMaxHealth() { + return 40; + } + @Override public void baseTick() { super.baseTick(); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java index cf300f11..37381e40 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java @@ -1,6 +1,7 @@ package sunsetsatellite.signalindustries.gui; +import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.EntityPlayerSP; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiContainer; @@ -10,13 +11,17 @@ import net.minecraft.core.lang.I18n; import net.minecraft.core.player.inventory.IInventory; import net.minecraft.core.player.inventory.InventoryPlayer; +import net.minecraft.core.util.helper.Side; import net.minecraft.server.entity.player.EntityPlayerMP; import org.lwjgl.opengl.GL11; +import sunsetsatellite.catalyst.core.util.Vec3f; +import sunsetsatellite.catalyst.core.util.Vec3i; import sunsetsatellite.catalyst.fluids.api.IFluidInventory; import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered; import sunsetsatellite.signalindustries.containers.ContainerExternalIO; import sunsetsatellite.signalindustries.inventories.TileEntityExternalIO; +import sunsetsatellite.signalindustries.util.Tier; public class GuiExternalIO extends GuiContainer { @@ -31,48 +36,13 @@ public GuiExternalIO(InventoryPlayer inventoryPlayer, TileEntity tile) { this.entityplayer = inventoryPlayer.player; } - @Override - public void drawScreen(int x, int y, float renderPartialTicks) { - int i = (width - xSize) / 2; - int j = (height - ySize) / 2; - super.drawScreen(x, y, renderPartialTicks); - I18n trans = I18n.getInstance(); - StringBuilder text = new StringBuilder(); - if(x > i+80 && x < i+94){ - if(y > j+40 && y < j+46){ - text.append("View Recipes"); - GuiTooltip tooltip = new GuiTooltip(mc); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - tooltip.render(text.toString(),x,y,8,-8); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_CULL_FACE); - } - } - } - - @Override - public void mouseClicked(int x, int y, int button) { - int i = (width - xSize) / 2; - int j = (height - ySize) / 2; - if(x > i+80 && x < i+94) { - if (y > j + 40 && y < j + 46) { - I18n translator = I18n.getInstance(); - String name = translator.translateKey(tile.getBlockType().getLanguageKey(0)+".name"); - //GuidebookPlusPlus.nameFocus = ">"+ name; - if(entityplayer instanceof EntityPlayerSP){ - ((EntityPlayerSP)entityplayer).displayGUIGuidebook(); - } else if (entityplayer instanceof EntityPlayerMP) { - ((EntityPlayerMP)entityplayer).displayGUIGuidebook(); - } - } - } - super.mouseClicked(x, y, button); - } @Override protected void drawGuiContainerBackgroundLayer(float f1) { int i2 = this.mc.renderEngine.getTexture("/assets/signalindustries/gui/basic_gui_blank.png"); + if(tile.tier == Tier.REINFORCED){ + i2 = this.mc.renderEngine.getTexture("/assets/signalindustries/gui/reinforced_gui_base.png"); + } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(i2); int i3 = (this.width - this.xSize) / 2; @@ -100,11 +70,38 @@ protected void drawGuiContainerForegroundLayer() fontRenderer.drawCenteredString(name, 90, 6, color); int x = (this.xSize) / 2; int y = (this.ySize) / 4; - if(tile.externalTile != null){ - fontRenderer.drawCenteredString("Connected.",x,y,0xFF00FF00); - fontRenderer.drawCenteredString(tile.externalTile.getClass().getSimpleName()+ " @ " + tile.externalTileSide.getName(),x,y+12,0xFF00FF00); + if(tile.tier == Tier.REINFORCED){ + if(tile.externalTilePos == null){ + fontRenderer.drawCenteredString("Disconnected.",x,y,0xFFFF0000); + fontRenderer.drawCenteredString("No position.",x,y+12,0xFFFF0000); + } else if(tile.externalTilePos.containsKey("x") && tile.externalTilePos.containsKey("y") && tile.externalTilePos.containsKey("z") && tile.externalTilePos.containsKey("dim") && tile.externalTilePos.containsKey("side")){ + if(tile.externalTile != null){ + fontRenderer.drawCenteredString("Connected.",x,y,0xFF00FF00); + fontRenderer.drawCenteredString(tile.externalTile.getClass().getSimpleName()+ " @ " + tile.externalTile.x +" "+tile.externalTile.y+" "+tile.externalTile.z,x,y+12,0xFF00FF00); + fontRenderer.drawCenteredString(String.valueOf(Side.getSideById(tile.externalTilePos.getInteger("side"))),x,y+24,0xFF00FF00); + } else { + int eX = tile.externalTilePos.getInteger("x"); + int eY = tile.externalTilePos.getInteger("y"); + int eZ = tile.externalTilePos.getInteger("z"); + int dim = tile.externalTilePos.getInteger("dim"); + Vec3i pos = new Vec3i(eX,eY,eZ); + Vec3f selfPos = new Vec3f(tile.x,tile.y,tile.z); + if(dim != tile.worldObj.dimension.id){ + fontRenderer.drawCenteredString("Can't connect.",x,y,0xFFFFA500); + fontRenderer.drawCenteredString("Outside this world.",x,y+12,0xFFFFA500); + } else if(pos.distanceTo(selfPos) > TileEntityExternalIO.range){ + fontRenderer.drawCenteredString("Can't connect.",x,y,0xFFFFA500); + fontRenderer.drawCenteredString("Out of reach.",x,y+12,0xFFFFA500); + } + } + } } else { - fontRenderer.drawCenteredString("Disconnected.",x,y,0xFFFF0000); + if(tile.externalTile != null){ + fontRenderer.drawCenteredString("Connected.",x,y,0xFF00FF00); + fontRenderer.drawCenteredString(tile.externalTile.getClass().getSimpleName()+ " @ " + tile.externalTileSide.getName(),x,y+12,0xFF00FF00); + } else { + fontRenderer.drawCenteredString("Disconnected.",x,y,0xFFFF0000); + } } } protected void buttonPressed(GuiButton guibutton) { @@ -118,6 +115,11 @@ protected void buttonPressed(GuiButton guibutton) { case 1: SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; + case 2: + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Link removed!"); + tile.externalTile = null; + tile.externalTileSide = null; + tile.externalTilePos = null; default: break; } @@ -127,6 +129,7 @@ public void init() { GuiButton fluidIo = new GuiButton(0, Math.round(width / 2) + 60, Math.round(height / 2) - 80, 20, 20, "F"); GuiButton itemIo = new GuiButton(1, Math.round(width / 2) + 60, Math.round(height / 2) - 60, 20, 20, "I"); + GuiButton removeLink = new GuiButton(2, Math.round(width / 2) - 80, Math.round(height / 2) - 80, 20, 20, "X"); if(!(tile.externalTile instanceof IInventory)){ itemIo.enabled = false; } @@ -135,6 +138,7 @@ public void init() } controlList.add(fluidIo); controlList.add(itemIo); + controlList.add(removeLink); super.init(); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFilter.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFilter.java new file mode 100644 index 00000000..ac35efb7 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFilter.java @@ -0,0 +1,66 @@ +package sunsetsatellite.signalindustries.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiContainer; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.player.inventory.InventoryPlayer; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.signalindustries.containers.ContainerFilter; +import sunsetsatellite.signalindustries.inventories.TileEntityFilter; +import sunsetsatellite.signalindustries.inventories.TileEntityFilter.FilterSide; + +public class GuiFilter extends GuiContainer { + public String name = "Filter"; + public EntityPlayer entityplayer; + public TileEntityFilter tile; + + + public GuiFilter(InventoryPlayer inventoryPlayer, TileEntity tile) { + super(new ContainerFilter(inventoryPlayer, (TileEntityFilter) tile)); + this.tile = (TileEntityFilter) tile; + this.entityplayer = inventoryPlayer.player; + this.ySize = 233; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f1) { + + int i2 = this.mc.renderEngine.getTexture("/assets/signalindustries/gui/filter.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(i2); + int i3 = (this.width - this.xSize) / 2; + int i4 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i3, i4, 0, 0, this.xSize, this.ySize); + } + + @Override + protected void drawGuiContainerForegroundLayer() { + super.drawGuiContainerForegroundLayer(); + fontRenderer.drawString(name, 76, 6, 4210752,false); + } + + @Override + protected void buttonPressed(GuiButton button) { + if(button.id == 0){ + int ord = tile.defaultSide.ordinal(); + if(ord++ >= FilterSide.values().length-1){ + ord = 0; + } + tile.defaultSide = FilterSide.values()[ord]; + button.displayString = "Default: " + (ord+1) + " ("+tile.defaultSide.name()+")"; + } else if (button.id == 1) { + tile.ignoreMeta = !tile.ignoreMeta; + button.displayString = tile.ignoreMeta ? "!M" : "M"; + } + } + + @Override + public void init() { + int w = (this.width - this.xSize) / 2; + int h = (this.height - this.ySize) / 2; + controlList.add(new GuiButton(0,w+8+22,h+128,120,20,"Default: "+(tile.defaultSide.ordinal()+1)+" ("+tile.defaultSide.name()+")")); + controlList.add(new GuiButton(1,w+8,h+128,20,20, tile.ignoreMeta ? "!M" : "M")); + super.init(); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java index 2e8056c6..18a1045c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java @@ -9,7 +9,7 @@ import net.minecraft.core.entity.player.EntityPlayer; import net.minecraft.core.player.inventory.Container; import net.minecraft.core.player.inventory.IInventory; -import net.minecraft.core.sound.SoundType; +import net.minecraft.core.sound.SoundCategory; import org.lwjgl.opengl.GL11; import sunsetsatellite.catalyst.core.util.Connection; import sunsetsatellite.catalyst.core.util.Direction; @@ -44,7 +44,7 @@ public void mouseClicked(int x, int y, int button) { for (int l = 0; l < this.controlList.size(); ++l) { GuiButton guibutton = this.controlList.get(l); if (guibutton.mouseClicked(this.mc, x, y)) { - this.mc.sndManager.playSound("random.click", SoundType.GUI_SOUNDS, 1.0F, 1.0F); + this.mc.sndManager.playSound("random.click", SoundCategory.GUI_SOUNDS, 1.0F, 1.0F); action2Performed(guibutton); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java index c0bb60a2..7c974cdb 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java @@ -1,6 +1,7 @@ package sunsetsatellite.signalindustries.gui; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.render.Lighting; @@ -8,14 +9,14 @@ import net.minecraft.core.block.entity.TileEntity; import net.minecraft.core.entity.player.EntityPlayer; import net.minecraft.core.player.inventory.Container; -import net.minecraft.core.sound.SoundType; + +import net.minecraft.core.sound.SoundCategory; import org.lwjgl.opengl.GL11; import sunsetsatellite.catalyst.core.util.Connection; import sunsetsatellite.catalyst.core.util.Direction; import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidItemContainer; import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.interfaces.IHasIOPreview; -import sunsetsatellite.signalindustries.inventories.base.TileEntityTieredMachineBase; import sunsetsatellite.signalindustries.util.IOPreview; @@ -42,7 +43,7 @@ public void mouseClicked(int x, int y, int button) { for (int l = 0; l < this.controlList.size(); ++l) { GuiButton guibutton = this.controlList.get(l); if (guibutton.mouseClicked(this.mc, x, y)) { - this.mc.sndManager.playSound("random.click", SoundType.GUI_SOUNDS, 1.0F, 1.0F); + this.mc.sndManager.playSound("random.click", SoundCategory.GUI_SOUNDS, 1.0F, 1.0F); action2Performed(guibutton); } } @@ -78,7 +79,7 @@ protected void drawGuiContainerBackgroundLayer(float f) } @Override - public void drawScreen(int x, int y, float renderPartialTicks) { + public void drawScreen(int mouseX, int mouseY, float renderPartialTicks) { this.drawDefaultBackground(); int centerX = (this.width - this.xSize) / 2; int centerY = (this.height - this.ySize) / 2; @@ -97,10 +98,9 @@ public void drawScreen(int x, int y, float renderPartialTicks) { GL11.glDisable(2929); this.drawGuiContainerForegroundLayer(); GL11.glPopMatrix(); - super.drawScreen(x, y, renderPartialTicks); + super.drawScreen(mouseX, mouseY, renderPartialTicks); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(2929); - } @Override @@ -171,21 +171,21 @@ protected void buttonPressed(GuiButton guibutton) { } if(guibutton.id == 12){ for (Direction direction : Direction.values()) { - tile.connections.replace(direction,Connection.INPUT); + tile.itemConnections.replace(direction,Connection.INPUT); } for (GuiButton button : controlList) { if(button.id >= 0 && button.id < 6){ - button.displayString = tile.connections.get(Direction.values()[button.id]).getLetter(); + button.displayString = tile.itemConnections.get(Direction.values()[button.id]).getLetter(); } } } if(guibutton.id == 13){ for (Direction direction : Direction.values()) { - tile.connections.replace(direction,Connection.OUTPUT); + tile.itemConnections.replace(direction,Connection.OUTPUT); } for (GuiButton button : controlList) { if(button.id >= 0 && button.id < 6){ - button.displayString = tile.connections.get(Direction.values()[button.id]).getLetter(); + button.displayString = tile.itemConnections.get(Direction.values()[button.id]).getLetter(); } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiRestrictPipeConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiRestrictPipeConfig.java new file mode 100644 index 00000000..47157e75 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiRestrictPipeConfig.java @@ -0,0 +1,140 @@ +package sunsetsatellite.signalindustries.gui; + + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.render.Lighting; +import net.minecraft.client.render.entity.ItemEntityRenderer; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.player.inventory.Container; +import net.minecraft.core.sound.SoundCategory; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.catalyst.core.util.Connection; +import sunsetsatellite.catalyst.core.util.Direction; +import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidItemContainer; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.interfaces.IHasIOPreview; +import sunsetsatellite.signalindustries.inventories.TileEntityItemConduit; +import sunsetsatellite.signalindustries.util.IOPreview; +import sunsetsatellite.signalindustries.util.PipeMode; + + +public class GuiRestrictPipeConfig extends GuiScreen { + + public GuiScreen parentScreen; + public EntityPlayer entityplayer; + public TileEntityItemConduit tile; + public int xSize = 176; + public int ySize = 166; + private static final ItemEntityRenderer itemRenderer = new ItemEntityRenderer(); + public GuiRestrictPipeConfig(EntityPlayer player, TileEntity tile, GuiScreen parent) { + super(parent); + this.tile = (TileEntityItemConduit) tile; + this.parentScreen = parent; + this.entityplayer = player; + } + + public void mouseClicked(int x, int y, int button) { + super.mouseClicked(x,y,button); + if (button == 1) { + for (int l = 0; l < this.controlList.size(); ++l) { + GuiButton guibutton = this.controlList.get(l); + if (guibutton.mouseClicked(this.mc, x, y)) { + this.mc.sndManager.playSound("random.click", SoundCategory.GUI_SOUNDS, 1.0F, 1.0F); + } + } + } + } + + protected void drawGuiContainerBackgroundLayer(float f) + { + int i = mc.renderEngine.getTexture("/assets/signalindustries/gui/ioconfig.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(i); + int j = (width - xSize) / 2; + int k = (height - ySize) / 2; + drawTexturedModalRect(j, k, 0, 0, xSize, ySize); + } + + @Override + public void drawScreen(int x, int y, float renderPartialTicks) { + this.drawDefaultBackground(); + int centerX = (this.width - this.xSize) / 2; + int centerY = (this.height - this.ySize) / 2; + this.drawGuiContainerBackgroundLayer(renderPartialTicks); + GL11.glPushMatrix(); + GL11.glRotatef(120.0F, 1.0F, 0.0F, 0.0F); + Lighting.enableInventoryLight(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)centerX, (float)centerY, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(32826); + GL11.glDisable(32826); + Lighting.disable(); + GL11.glDisable(2896); + GL11.glDisable(2929); + this.drawGuiContainerForegroundLayer(); + GL11.glPopMatrix(); + super.drawScreen(x, y, renderPartialTicks); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(2929); + + } + + @Override + public void init() { + controlList.add(new GuiButton(2, Math.round(width / 2) - 10, Math.round(height / 2) - 63, 15, 15, tile.restrictDirections.get(Direction.Y_POS) ? "R" : "-")); //Y+ + controlList.add(new GuiButton(4, Math.round(width / 2) - 10, Math.round(height / 2) - 48, 15, 15, tile.restrictDirections.get(Direction.Z_POS) ? "R" : "-")); //Z+ + controlList.add(new GuiButton(3, Math.round(width / 2) - 10, Math.round(height / 2) - 33, 15, 15, tile.restrictDirections.get(Direction.Y_NEG) ? "R" : "-")); //Y- + controlList.add(new GuiButton(0, Math.round(width / 2) + 4, Math.round(height / 2) - 48, 15, 15, tile.restrictDirections.get(Direction.X_POS) ? "R" : "-")); //X+ + controlList.add(new GuiButton(1, Math.round(width / 2) - 24, Math.round(height / 2) - 48, 15, 15, tile.restrictDirections.get(Direction.X_NEG) ? "R" : "-")); //X- + controlList.add(new GuiButton(5, Math.round(width / 2) + 4, Math.round(height / 2) - 33, 15, 15, tile.restrictDirections.get(Direction.Z_NEG) ? "R" : "-")); //Z- + + controlList.add(new GuiButton(6, Math.round(width / 2) + 4 + 22, Math.round(height / 2) - 48, 50, 15, String.valueOf(tile.mode))); + + super.init(); + } + + @Override + protected void buttonPressed(GuiButton guibutton) { + if(tile != null){ + if(guibutton.id >= 0 && guibutton.id < 6){ + if (tile.restrictDirections.get(Direction.values()[guibutton.id])) { + tile.restrictDirections.replace(Direction.values()[guibutton.id], false); + } else { + tile.restrictDirections.replace(Direction.values()[guibutton.id], true); + } + + guibutton.displayString = tile.restrictDirections.get(Direction.values()[guibutton.id]) ? "R" : "-"; + + } + if(guibutton.id == 6){ + switch (tile.mode){ + case RANDOM: + tile.mode = PipeMode.SPLIT; + break; + case SPLIT: + tile.mode = PipeMode.RANDOM; + break; + } + guibutton.displayString = String.valueOf(tile.mode); + } + } + super.buttonPressed(guibutton); + } + + protected void drawGuiContainerForegroundLayer() + { + fontRenderer.drawString("Configure: Restriction", 36, 6, 0xFF404040); + fontRenderer.drawString("R/-", 78, 70, 0xFF404040); + fontRenderer.drawString("Mode", 128, 70, 0xFF404040); + fontRenderer.drawString("Y+", 26, 22, 0xFFFFFFFF); + fontRenderer.drawString("Y-", 26, 58, 0xFFFFFFFF); + fontRenderer.drawString("Z+", 26, 40, 0xFFFFFFFF); + fontRenderer.drawString("X+", 44, 40, 0xFFFFFFFF); + fontRenderer.drawString("Z-", 44, 58, 0xFFFFFFFF); + fontRenderer.drawString("X-", 8, 40, 0xFFFFFFFF); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockPage.java b/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockPage.java index 9c3560e0..767527ea 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockPage.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockPage.java @@ -9,7 +9,7 @@ import net.minecraft.core.lang.I18n; import org.lwjgl.opengl.GL11; import sunsetsatellite.catalyst.multiblocks.Multiblock; -import sunsetsatellite.signalindustries.util.RenderMultiblockInGuidebook; +import sunsetsatellite.signalindustries.render.RenderMultiblockInGuidebook; public class MultiblockPage extends GuidebookPage { diff --git a/src/main/java/sunsetsatellite/signalindustries/interfaces/IAcceptsPosition.java b/src/main/java/sunsetsatellite/signalindustries/interfaces/IAcceptsPosition.java new file mode 100644 index 00000000..a84a6a96 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/interfaces/IAcceptsPosition.java @@ -0,0 +1,7 @@ +package sunsetsatellite.signalindustries.interfaces; + +import net.minecraft.core.util.helper.Side; + +public interface IAcceptsPosition { + void receivePosition(int x, int y, int z, Side side, int dim); +} diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java index de15c575..c945389a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java @@ -1,25 +1,31 @@ package sunsetsatellite.signalindustries.inventories; import com.mojang.nbt.CompoundTag; +import net.minecraft.client.Minecraft; import net.minecraft.core.block.BlockFluid; import net.minecraft.core.block.entity.TileEntity; import net.minecraft.core.entity.player.EntityPlayer; import net.minecraft.core.item.ItemStack; import net.minecraft.core.player.inventory.IInventory; +import net.minecraft.core.util.helper.Side; import org.jetbrains.annotations.NotNull; -import sunsetsatellite.catalyst.core.util.Connection; -import sunsetsatellite.catalyst.core.util.Direction; +import sunsetsatellite.catalyst.core.util.*; import sunsetsatellite.catalyst.fluids.api.IFluidInventory; import sunsetsatellite.catalyst.fluids.api.IFluidTransfer; import sunsetsatellite.catalyst.fluids.util.FluidStack; +import sunsetsatellite.signalindustries.interfaces.IAcceptsPosition; +import sunsetsatellite.signalindustries.interfaces.mixins.INBTCompound; import sunsetsatellite.signalindustries.inventories.base.TileEntityTieredMachineBase; +import sunsetsatellite.signalindustries.util.Tier; import java.util.ArrayList; -public class TileEntityExternalIO extends TileEntityTieredMachineBase { +public class TileEntityExternalIO extends TileEntityTieredMachineBase implements IAcceptsPosition { public TileEntity externalTile; public Direction externalTileSide; + public CompoundTag externalTilePos; + public static int range = 5; public TileEntityExternalIO(){ } @@ -64,19 +70,21 @@ public String getInvName() { } @Override - public void readFromNBT(CompoundTag CompoundTag1) { - if(externalTile != null) { + public void readFromNBT(CompoundTag tag) { + /*if(externalTile != null) { externalTile.readFromNBT(CompoundTag1); - } - super.readFromNBT(CompoundTag1); + }*/ + super.readFromNBT(tag); + externalTilePos = tag.getCompound("externalPosition"); } @Override - public void writeToNBT(CompoundTag CompoundTag1) { - if(externalTile != null) { + public void writeToNBT(CompoundTag tag) { + /*if(externalTile != null) { externalTile.writeToNBT(CompoundTag1); - } - super.writeToNBT(CompoundTag1); + }*/ + super.writeToNBT(tag); + tag.put("externalPosition",externalTilePos); } @Override @@ -208,12 +216,41 @@ public void tick() { super.tick(); worldObj.markBlocksDirty(x, y, z, x, y, z); if(externalTile == null){ - for (Direction dir : Direction.values()) { - TileEntity tile = dir.getTileEntity(worldObj,this); - if(tile instanceof IInventory || tile instanceof IFluidInventory){ - if(!(tile instanceof TileEntityExternalIO)){ - externalTile = tile; - externalTileSide = dir; + if(tier == Tier.BASIC){ + for (Direction dir : Direction.values()) { + TileEntity tile = dir.getTileEntity(worldObj, this); + if (tile instanceof IInventory || tile instanceof IFluidInventory) { + if (!(tile instanceof TileEntityExternalIO)) { + externalTile = tile; + externalTileSide = dir; + CompoundTag pos = new CompoundTag(); + pos.putInt("x", externalTile.x); + pos.putInt("y", externalTile.y); + pos.putInt("z", externalTile.z); + pos.putInt("side", dir.getSide()); + pos.putInt("dim", externalTile.worldObj.dimension.id); + externalTilePos = pos; + } + } + } + } else if (tier == Tier.REINFORCED) { + if(externalTilePos != null){ + if(externalTilePos.containsKey("x") && externalTilePos.containsKey("y") && externalTilePos.containsKey("z") && externalTilePos.containsKey("dim") && externalTilePos.containsKey("side")){ + int eX = externalTilePos.getInteger("x"); + int eY = externalTilePos.getInteger("y"); + int eZ = externalTilePos.getInteger("z"); + int dim = externalTilePos.getInteger("dim"); + Vec3i pos = new Vec3i(eX,eY,eZ); + Vec3f selfPos = new Vec3f(x,y,z); + if(pos.distanceTo(selfPos) < range && dim == worldObj.dimension.id){ + TileEntity tile = worldObj.getBlockTileEntity(externalTilePos.getInteger("x"),externalTilePos.getInteger("y"),externalTilePos.getInteger("z")); + if (tile instanceof IInventory || tile instanceof IFluidInventory) { + if (!(tile instanceof TileEntityExternalIO)) { + externalTile = tile; + externalTileSide = Direction.getDirectionFromSide(externalTilePos.getInteger("side")); + } + } + } } } } @@ -221,8 +258,41 @@ public void tick() { if(worldObj.getBlockTileEntity(externalTile.x,externalTile.y,externalTile.z) != externalTile){ externalTile = null; externalTileSide = null; + externalTilePos = null; } } } + @Override + public void receivePosition(int x, int y, int z, Side side, int dim) { + if(tier == Tier.REINFORCED){ + Vec3i pos = new Vec3i(x,y,z); + Vec3f selfPos = new Vec3f(this.x,this.y,this.z); + CompoundTag tag = new CompoundTag(); + tag.putInt("x", x); + tag.putInt("y", y); + tag.putInt("z", z); + tag.putInt("side", side.getId()); + tag.putInt("dim", dim); + externalTilePos = tag; + TileEntity tile = worldObj.getBlockTileEntity(x,y,z); + if(pos.distanceTo(selfPos) < range){ + if(dim == worldObj.dimension.id){ + if(tile instanceof IInventory || tile instanceof IFluidInventory) { + if (!(tile instanceof TileEntityExternalIO)) { + externalTile = tile; + externalTileSide = Direction.getDirectionFromSide(side.getId()); + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Link established!"); + } + } else { + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("invalid block at position!"); + } + } else { + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Position outside this world!"); + } + } else { + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Position out of reach!"); + } + } + } } diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityFilter.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityFilter.java new file mode 100644 index 00000000..f35d072f --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityFilter.java @@ -0,0 +1,128 @@ +package sunsetsatellite.signalindustries.inventories; + +import com.mojang.nbt.CompoundTag; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.item.ItemStack; +import sunsetsatellite.catalyst.core.util.Direction; +import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidItemContainer; +import sunsetsatellite.catalyst.fluids.util.FluidStack; +import sunsetsatellite.signalindustries.inventories.TileEntityItemConduit.PipeItem; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class TileEntityFilter extends TileEntityFluidItemContainer { + + public boolean ignoreMeta = false; + public FilterSide defaultSide = FilterSide.MAGENTA; + + public TileEntityFilter(){ + fluidContents = new FluidStack[0]; + fluidCapacity = new int[0]; + itemContents = new ItemStack[9*6]; + } + + @Override + public void tick() { + worldObj.markBlockDirty(x,y,z); + super.tick(); + } + + public void sort(Direction inputDir, PipeItem item, TileEntityItemConduit conduit){ + FilterSide outputSide = getFilterColor(item.getStack()); + if(outputSide == null){ + conduit.dropItem(item,null); + return; + } + Set directionSet = getSurroundings().keySet(); + if (!directionSet.contains(outputSide.getDirection())) { + conduit.dropItem(item,null); + return; + } + for (Map.Entry entry : getSurroundings().entrySet()) { + if(entry.getKey() == outputSide.getDirection()){ + TileEntityItemConduit tile = entry.getValue(); + boolean success = tile.addItem(item.getStack(), outputSide.getDirection().getOpposite()); + if(!success){ + conduit.dropItem(item,null); + return; + } else { + conduit.getContents().remove(item); + return; + } + } + } + } + + public HashMap getSurroundings(){ + HashMap surroundings = new HashMap<>(); + for (Direction dir : Direction.values()) { + TileEntity tile = dir.getTileEntity(worldObj,this); + if(tile != null){ + if(tile instanceof TileEntityItemConduit){ + surroundings.put(dir, (TileEntityItemConduit) tile); + } + } + } + return surroundings; + } + + public FilterSide getFilterColor(ItemStack stack) { + for(int i2 = 0; i2 < this.itemContents.length; ++i2) { + if(this.itemContents[i2] != null && this.itemContents[i2].itemID == stack.itemID && (this.itemContents[i2].getMetadata() == stack.getMetadata()) || ignoreMeta) { + return FilterSide.values()[i2/9]; + } + } + + return defaultSide; + } + + + @Override + public String getInvName() { + return "Filter"; + } + + @Override + public void writeToNBT(CompoundTag tag) { + super.writeToNBT(tag); + tag.putBoolean("IgnoreMeta",ignoreMeta); + tag.putInt("DefaultSide",defaultSide.ordinal()); + } + + @Override + public void readFromNBT(CompoundTag tag) { + super.readFromNBT(tag); + ignoreMeta = tag.getBoolean("IgnoreMeta"); + defaultSide = FilterSide.values()[tag.getInteger("DefaultSide")]; + } + + public enum FilterSide { + RED(Direction.Y_POS), + GREEN(Direction.Z_NEG), + BLUE(Direction.X_NEG), + CYAN(Direction.Y_NEG), + MAGENTA(Direction.Z_POS), + YELLOW(Direction.X_POS); + + private final Direction direction; + + FilterSide(Direction direction) { + this.direction = direction; + } + + public Direction getDirection() { + return direction; + } + + public static FilterSide getFromDirection(Direction dir){ + for (FilterSide side : values()) { + if(side.getDirection() == dir){ + return side; + } + } + return null; + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInserter.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInserter.java index 523b839c..a362a542 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInserter.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInserter.java @@ -66,7 +66,7 @@ public void applyModifiers(){ public void work(){ TileEntity inv = input.getTileEntity(worldObj,this); TileEntity pipe = output.getTileEntity(worldObj,this); - AABB aabb = getBlockType().getSelectedBoundingBoxFromPool(worldObj,x,y,z).expand(input.getVecF().x,input.getVecF().y,input.getVecF().z); + AABB aabb = getBlockType().getSelectedBoundingBoxFromPool(worldObj,x,y,z).copy().offset(input.getVecF().x,input.getVecF().y,input.getVecF().z); List items = worldObj.getEntitiesWithinAABB(EntityItem.class,aabb).stream().map((E)->((EntityItem)E)).collect(Collectors.toList()); if(pipe instanceof TileEntityItemConduit && inv instanceof IInventory){ int slot = -1; @@ -92,6 +92,9 @@ public void work(){ if(!success){ stack.stackSize += split.stackSize; } + if(stack.stackSize <= 0){ + ((IInventory) inv).setInventorySlotContents(slot,null); + } } else if (pipe instanceof TileEntityItemConduit && !items.isEmpty()) { EntityItem item = items.get(0); ItemStack split; @@ -107,11 +110,11 @@ public void work(){ } else { if(item.item.itemID < 16384){ for (int i = 0; i < 4; i++) { - SignalIndustries.spawnParticle(new EntityDiggingFX(worldObj, item.x, item.y, item.z, 0,0,0, Block.getBlock(item.item.itemID),0,0)); + SignalIndustries.spawnParticle(new EntityDiggingFX(worldObj, item.x, item.y, item.z, 0,0,0, Block.getBlock(item.item.itemID),0)); } } else { for (int i = 0; i < 4; i++) { - SignalIndustries.spawnParticle(new EntityDiggingFX(worldObj, item.x, item.y, item.z, 0,0,0, getBlockType(),0,0)); + SignalIndustries.spawnParticle(new EntityDiggingFX(worldObj, item.x, item.y, item.z, 0,0,0, getBlockType(),0)); } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityItemConduit.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityItemConduit.java index 6af1736d..85c19a72 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityItemConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityItemConduit.java @@ -1,5 +1,6 @@ package sunsetsatellite.signalindustries.inventories; +import com.mojang.nbt.ByteTag; import com.mojang.nbt.CompoundTag; import com.mojang.nbt.Tag; import net.minecraft.core.block.entity.TileEntity; @@ -7,23 +8,40 @@ import net.minecraft.core.item.ItemStack; import net.minecraft.core.player.inventory.IInventory; import sunsetsatellite.catalyst.core.util.*; +import sunsetsatellite.signalindustries.blocks.BlockItemConduit; +import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered; +import sunsetsatellite.signalindustries.blocks.base.BlockTiered; +import sunsetsatellite.signalindustries.interfaces.ITiered; +import sunsetsatellite.signalindustries.inventories.base.TileEntityWithName; +import sunsetsatellite.signalindustries.items.ItemTiered; import sunsetsatellite.signalindustries.util.PipeMode; +import sunsetsatellite.signalindustries.util.PipeType; +import sunsetsatellite.signalindustries.util.Tier; import java.util.*; import java.util.stream.Collectors; //TODO: extract + split -//TODO: Have pipes try to insert items multiple times (until all directions are invalid) //TODO: more modes -public class TileEntityItemConduit extends TileEntity { +public class TileEntityItemConduit extends TileEntityWithName { - public static final int TRANSFER_TICKS = 20*3; - public static final int EXTRACT_TICKS = 20*2; + public static int TRANSFER_TICKS = 20*3; + public static int EXTRACT_TICKS = 20*2; private final TickTimer extractTimer = new TickTimer(this, this::extractItem, EXTRACT_TICKS, true); private final List contents = new ArrayList<>(); public PipeMode mode = PipeMode.RANDOM; private final Random random = new Random(); + public Tier tier = Tier.PROTOTYPE; + public PipeType type = PipeType.NORMAL; + + public Map restrictDirections = new HashMap<>(); + + public TileEntityItemConduit(){ + for (Direction dir : Direction.values()) { + restrictDirections.put(dir,false); + } + } public List getContents() { return contents; @@ -39,7 +57,7 @@ public boolean addItem(ItemStack stack, Direction entry){ Direction exit = null; //select the exit direction based on mode if(mode == PipeMode.RANDOM){ - exit = pickRandomExitDirection(exitList); + exit = pickRandomExitDirection(exitList,stack); } else if (mode == PipeMode.SPLIT) { //split stack into multiple pipe items going into every possible direction List exits = exitList.stream().filter((E)->surroundings.get(E.getKey()) instanceof IItemIO || surroundings.get(E.getKey()) instanceof IInventory || surroundings.get(E.getKey()) instanceof TileEntityItemConduit).map(Map.Entry::getKey).collect(Collectors.toList()); @@ -79,7 +97,7 @@ public boolean addItem(ItemStack stack, Direction entry){ return true; } - private void dropItem(PipeItem item, Iterator iter){ + public void dropItem(PipeItem item, Iterator iter){ if(contents.contains(item)){ Vec3f dirVec = item.exit.getVecF().divide(2); Vec3f offset = new Vec3f(x,y,z).add(dirVec).add(0.5); @@ -89,7 +107,11 @@ private void dropItem(PipeItem item, Iterator iter){ entityitem.yd = dirVec.y * multiplier; entityitem.zd = dirVec.z * multiplier; worldObj.entityJoinedWorld(entityitem); - iter.remove(); + if(iter != null){ + iter.remove(); + } else { + contents.remove(item); + } } } @@ -132,7 +154,7 @@ public void extractItem(){ Direction exit = null; //select the exit direction based on mode if(mode == PipeMode.RANDOM){ - exit = pickRandomExitDirection(exitList); + exit = pickRandomExitDirection(exitList,stack); } else if (mode == PipeMode.SPLIT) { //split stack into multiple pipe items going into every possible direction List exits = exitList.stream().filter((E)->surroundings.get(E.getKey()) instanceof IItemIO || surroundings.get(E.getKey()) instanceof IInventory || surroundings.get(E.getKey()) instanceof TileEntityItemConduit).map(Map.Entry::getKey).collect(Collectors.toList()); @@ -191,7 +213,7 @@ private void acceptItem(Direction entry, PipeItem item, TileEntityItemConduit co } Direction exit = null; if(mode == PipeMode.RANDOM){ - exit = pickRandomExitDirection(exitList); + exit = pickRandomExitDirection(exitList, item.stack); } else if (mode == PipeMode.SPLIT) { //split stack into multiple pipe items going into every possible direction List exits = exitList.stream().filter((E)->surroundings.get(E.getKey()) instanceof IItemIO || surroundings.get(E.getKey()) instanceof IInventory || surroundings.get(E.getKey()) instanceof TileEntityItemConduit).map(Map.Entry::getKey).collect(Collectors.toList()); @@ -232,11 +254,40 @@ private void acceptItem(Direction entry, PipeItem item, TileEntityItemConduit co } } - private Direction pickRandomExitDirection(List> exitList){ + private Direction pickRandomExitDirection(List> exitList, ItemStack stack){ + List blockedDirs = new ArrayList<>(); for (Map.Entry exitEntry : exitList) { if(exitEntry.getValue() instanceof IItemIO || exitEntry.getValue() instanceof IInventory){ - return exitEntry.getKey(); + if(exitEntry.getValue() instanceof IItemIO){ + IItemIO io = (IItemIO) exitEntry.getValue(); + if(io.getItemIOForSide(exitEntry.getKey().getOpposite()) == Connection.INPUT || io.getItemIOForSide(exitEntry.getKey().getOpposite()) == Connection.BOTH){ + return exitEntry.getKey(); + } else { + blockedDirs.add(exitEntry.getKey()); + } + } else { + IInventory inv = (IInventory) exitEntry.getValue(); + for (int i = 0; i < inv.getSizeInventory(); i++) { + if(inv.getStackInSlot(i) == null){ + return exitEntry.getKey(); + } else if (inv.getStackInSlot(i).isItemEqual(stack) && inv.getStackInSlot(i).stackSize+stack.stackSize <= inv.getInventoryStackLimit() && inv.getStackInSlot(i).stackSize+stack.stackSize <= inv.getStackInSlot(i).getMaxStackSize(inv)) { + return exitEntry.getKey(); + } + } + blockedDirs.add(exitEntry.getKey()); + } + } + } + restrictDirections.forEach((D,B)->{ + if(B && !blockedDirs.contains(D)){ + blockedDirs.add(D); } + }); + exitList = exitList.stream().filter((E)->!(blockedDirs.contains(E.getKey()))).collect(Collectors.toList()); + if(exitList.isEmpty()){ + return null; + } else if (exitList.size() == 1) { + return exitList.get(0).getKey(); } return exitList.get(random.nextInt(exitList.size())).getKey(); } @@ -244,6 +295,23 @@ private Direction pickRandomExitDirection(List> @Override public void tick() { super.tick(); + worldObj.markBlockDirty(x,y,z); + if(worldObj != null && getBlockType() != null){ + tier = ((ITiered)getBlockType()).getTier(); + type = ((BlockItemConduit)getBlockType()).type; + } + switch (tier){ + case BASIC: + TRANSFER_TICKS = 20*3; + EXTRACT_TICKS = 20*2; + extractTimer.max = EXTRACT_TICKS; + break; + default: + TRANSFER_TICKS = 20*6; + EXTRACT_TICKS = 20*4; + extractTimer.max = EXTRACT_TICKS; + break; + } extractTimer.tick(); contents.removeIf((P)->P.stack == null); final Iterator iter = contents.iterator(); @@ -275,6 +343,7 @@ public HashMap getSurroundings(){ public void readFromNBT(CompoundTag nbttagcompound) { super.readFromNBT(nbttagcompound); CompoundTag items = nbttagcompound.getCompound("Items"); + CompoundTag restrict = nbttagcompound.getCompound("Restrictions"); for (Tag value : items.getValues()) { if(value instanceof CompoundTag){ CompoundTag itemNbt = (CompoundTag) value; @@ -282,18 +351,30 @@ public void readFromNBT(CompoundTag nbttagcompound) { contents.add(item); } } + for (Tag value : restrict.getValues()) { + if(value instanceof ByteTag){ + restrictDirections.replace(Direction.getFromName(value.getTagName()), ((Byte) value.getValue()) == 1); + } + } } @Override public void writeToNBT(CompoundTag nbttagcompound) { super.writeToNBT(nbttagcompound); CompoundTag items = new CompoundTag(); + CompoundTag restrict = new CompoundTag(); + for (Map.Entry entry : restrictDirections.entrySet()) { + Direction D = entry.getKey(); + Boolean B = entry.getValue(); + restrict.putBoolean(D.getName(), B); + } for (int i = 0; i < contents.size(); i++) { CompoundTag itemNbt = new CompoundTag(); PipeItem item = contents.get(i); item.writeToNBT(itemNbt); items.put(String.valueOf(i),itemNbt); } + nbttagcompound.put("Restrictions",restrict); nbttagcompound.put("Items",items); } @@ -347,6 +428,11 @@ public void writeToNBT(CompoundTag compoundTag) { public void insertItem(){ TileEntity tileEntity = exit.getTileEntity(worldObj, TileEntityItemConduit.this); Direction entry = exit.getOpposite(); + //treat the filter as a special case + if(tileEntity instanceof TileEntityFilter){ + ((TileEntityFilter)tileEntity).sort(entry.getOpposite(),this,TileEntityItemConduit.this); + return; + } if (tileEntity instanceof IItemIO && tileEntity instanceof IInventory) { IItemIO io = ((IItemIO) tileEntity); IInventory inv = ((IInventory) tileEntity); diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/machines/TileEntityReinforcedWrathBeacon.java b/src/main/java/sunsetsatellite/signalindustries/inventories/machines/TileEntityReinforcedWrathBeacon.java index 96cb634f..af89acb8 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/machines/TileEntityReinforcedWrathBeacon.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/machines/TileEntityReinforcedWrathBeacon.java @@ -102,7 +102,7 @@ public void tick() { } ticksSinceStart++; - if(player.health <= 0){ + if(player.getHealth() <= 0){ worldObj.setBlockWithNotify(x,y,z,0); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemPositionChip.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemPositionChip.java new file mode 100644 index 00000000..f6c93fcd --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemPositionChip.java @@ -0,0 +1,61 @@ +package sunsetsatellite.signalindustries.items; + +import com.mojang.nbt.CompoundTag; +import net.minecraft.client.Minecraft; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.net.command.TextFormatting; +import net.minecraft.core.util.helper.Side; +import net.minecraft.core.world.World; +import sunsetsatellite.catalyst.core.util.ICustomDescription; +import sunsetsatellite.signalindustries.interfaces.IAcceptsPosition; +import sunsetsatellite.signalindustries.interfaces.mixins.INBTCompound; + +public class ItemPositionChip extends Item implements ICustomDescription { + public ItemPositionChip(String name, int id) { + super(name, id); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if(entityplayer.isSneaking()){ + ((INBTCompound)itemstack.getData()).removeTag("position"); + Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Position cleared!"); + } + return super.onItemRightClick(itemstack, world, entityplayer); + } + + @Override + public boolean onItemUse(ItemStack itemStack, EntityPlayer entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) { + TileEntity tile = world.getBlockTileEntity(blockX,blockY,blockZ); + if(tile instanceof IAcceptsPosition){ + if(itemStack.getData().containsKey("position")){ + CompoundTag position = itemStack.getData().getCompound("position"); + if(position.containsKey("x") && position.containsKey("y") && position.containsKey("z") && position.containsKey("side") && position.containsKey("dim")){ + ((IAcceptsPosition) tile).receivePosition(position.getInteger("x"),position.getInteger("y"),position.getInteger("z"), Side.getSideById(position.getInteger("side")),position.getInteger("dim")); + return true; + } + } + } + CompoundTag position = new CompoundTag(); + position.putInt("x",blockX); + position.putInt("y",blockY); + position.putInt("z",blockZ); + position.putInt("dim",world.dimension.id); + position.putInt("side", side.getId()); + itemStack.getData().put("position",position); + Minecraft.getMinecraft(this).ingameGUI.addChatMessage(String.format("Position set to XYZ: %d, %d, %d!",blockX,blockY,blockZ)); + return true; + } + + @Override + public String getDescription(ItemStack stack) { + CompoundTag position = stack.getData().getCompound("position"); + if(position.containsKey("x") && position.containsKey("y") && position.containsKey("z") && position.containsKey("dim") && position.containsKey("side")){ + return String.format("XYZ: %s%d, %s%d, %s%d%s | Side: %s%s%s | Dim: %s%d%s",TextFormatting.RED,position.getInteger("x"),TextFormatting.LIME,position.getInteger("y"),TextFormatting.BLUE,position.getInteger("z"),TextFormatting.WHITE,TextFormatting.YELLOW,Side.getSideById(position.getInteger("side")),TextFormatting.WHITE,TextFormatting.MAGENTA,position.getInteger("dim"),TextFormatting.WHITE); + } + return TextFormatting.GRAY+"No position stored."+TextFormatting.WHITE; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java index 6fb47f09..0b2e93fb 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java @@ -59,7 +59,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer } if(itemstack.getData().getByte("charge") >= 100){ itemstack.getData().putByte("charge", (byte) 0); - world.playSoundAtEntity(entityplayer, "signalindustries.pulsar", 0.5F, 1.0f); + world.playSoundAtEntity(entityplayer, entityplayer, "signalindustries.pulsar", 0.5F, 1.0f); if(getAbility(itemstack).contains("Warp")){ ExplosionEnergy ex = new ExplosionEnergy(world,entityplayer,entityplayer.x,entityplayer.y,entityplayer.z,3f); ex.doExplosionA(); diff --git a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java index 63dc9624..cd30d8d4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java @@ -38,7 +38,7 @@ public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, Entit } if(stack.getData().getByte("charge") >= 100){ stack.getData().putByte("charge", (byte) 0); - world.playSoundAtEntity(player, "signalindustries.pulsar", 0.5F, 1.0f); + world.playSoundAtEntity(player,player, "signalindustries.pulsar", 0.5F, 1.0f); if(getAbility(stack).contains("Warp")){ ExplosionEnergy ex = new ExplosionEnergy(world,player,player.x,player.y,player.z,3f); ex.doExplosionA(); diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java index 57d2702f..8f0eca7a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java @@ -3,6 +3,8 @@ import net.minecraft.core.entity.EntityLiving; import net.minecraft.core.entity.monster.EntityMonster; import net.minecraft.core.entity.projectile.EntityArrow; +import net.minecraft.core.entity.projectile.EntityProjectile; +import net.minecraft.core.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -14,17 +16,17 @@ value = EntityArrow.class, remap = false ) -public class EntityArrowMixin { +public class EntityArrowMixin extends EntityProjectile { - @Shadow public EntityLiving owner; - - @Shadow protected int arrowDamage; + public EntityArrowMixin(World world) { + super(world); + } @Inject(method = "(Lnet/minecraft/core/world/World;Lnet/minecraft/core/entity/EntityLiving;ZI)V",at = @At("TAIL")) protected void init(CallbackInfo ci) { if(owner != null) { if(owner.world.getCurrentWeather() == SignalIndustries.weatherBloodMoon && owner instanceof EntityMonster){ - arrowDamage *= 2; + damage *= 2; } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java index cbb04eee..81d34aee 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java @@ -1,7 +1,7 @@ package sunsetsatellite.signalindustries.mixin; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.fx.EntitySlimeFX; +import net.minecraft.client.entity.fx.EntitySlimeChunkFX; import net.minecraft.client.render.Lighting; import net.minecraft.client.render.RenderEngine; import net.minecraft.client.render.RenderGlobal; @@ -52,7 +52,7 @@ public void spawnParticle(String s, double x, double y, double z, double xd, dou double d9 = 16.0; if (!(d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)) { if (s.equals("crystalbreak")) { - this.mc.effectRenderer.addEffect(new EntitySlimeFX(this.worldObj, x, y, z, SignalIndustries.signalumCrystal)); + this.mc.effectRenderer.addEffect(new EntitySlimeChunkFX(this.worldObj, x, y, z, SignalIndustries.signalumCrystal)); } if(s.equals("dustcloud")){ this.mc.effectRenderer.addEffect(new EntityDustCloudFX(this.worldObj,x,y,z,xd,yd,zd)); diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java index 59a5aac5..65437454 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java @@ -42,16 +42,8 @@ public abstract class WorldMixin implements IWorldDataAccessor { @Shadow public List players; - @Shadow public abstract boolean isDaytime(); - - @Shadow public abstract float getCelestialAngle(float f); - @Shadow public abstract long getWorldTime(); - @Shadow public abstract void playSoundAtEntity(Entity entity, String s, float f, float f1); - - @Shadow public abstract Explosion newExplosion(Entity entity, double d, double d1, double d2, float f, boolean flag, boolean isCannonBall); - @Shadow public Random rand; @Shadow @Final public SeasonManager seasonManager; @@ -62,10 +54,6 @@ public abstract class WorldMixin implements IWorldDataAccessor { @Shadow @Final public WeatherManager weatherManager; - @Shadow public abstract long getRandomSeed(); - - @Shadow public abstract void removeListener(LevelListener iworldaccess); - @Shadow @Final protected LevelStorage saveHandler; @Shadow @Final public WorldType worldType; diff --git a/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java b/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java index e6cbb516..66dfed76 100644 --- a/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java +++ b/src/main/java/sunsetsatellite/signalindustries/recipes/container/SIRecipes.java @@ -24,22 +24,42 @@ import java.util.stream.Stream; public class SIRecipes implements RecipeEntrypoint { - public static final RecipeNamespaceSI SIGNAL_INDUSTRIES = new RecipeNamespaceSI(); - public static final RecipeGroup> WORKBENCH = new RecipeGroup<>(new RecipeSymbol(new ItemStack(Block.workbench))); - public static final RecipeGroupSI EXTRACTOR = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeExtractor), new ItemStack(SignalIndustries.basicExtractor), new ItemStack(SignalIndustries.reinforcedExtractor)))); - public static final RecipeGroupSI CRUSHER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrusher),new ItemStack(SignalIndustries.basicCrusher)))); - public static final RecipeGroupSI ALLOY_SMELTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeAlloySmelter),new ItemStack(SignalIndustries.basicAlloySmelter)))); - public static final RecipeGroupSI PLATE_FORMER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePlateFormer),new ItemStack(SignalIndustries.basicPlateFormer),new ItemStack(SignalIndustries.reinforcedPlateFormer)))); - public static final RecipeGroupSI PUMP = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePump),new ItemStack(SignalIndustries.basicPump)))); - public static final RecipeGroupSI CRYSTAL_CUTTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrystalCutter),new ItemStack(SignalIndustries.basicCrystalCutter),new ItemStack(SignalIndustries.reinforcedCrystalCutter)))); - public static final RecipeGroupSI CRYSTAL_CHAMBER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicCrystalChamber)))); - public static final RecipeGroupSI INFUSER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicInfuser)))); - public static final RecipeGroupSI CENTRIFUGE = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.reinforcedCentrifuge)))); + public static RecipeNamespaceSI SIGNAL_INDUSTRIES = new RecipeNamespaceSI(); + public static RecipeGroup> WORKBENCH = new RecipeGroup<>(new RecipeSymbol(new ItemStack(Block.workbench))); + public static RecipeGroupSI EXTRACTOR = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeExtractor), new ItemStack(SignalIndustries.basicExtractor), new ItemStack(SignalIndustries.reinforcedExtractor)))); + public static RecipeGroupSI CRUSHER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrusher),new ItemStack(SignalIndustries.basicCrusher)))); + public static RecipeGroupSI ALLOY_SMELTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeAlloySmelter),new ItemStack(SignalIndustries.basicAlloySmelter)))); + public static RecipeGroupSI PLATE_FORMER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePlateFormer),new ItemStack(SignalIndustries.basicPlateFormer),new ItemStack(SignalIndustries.reinforcedPlateFormer)))); + public static RecipeGroupSI PUMP = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePump),new ItemStack(SignalIndustries.basicPump)))); + public static RecipeGroupSI CRYSTAL_CUTTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrystalCutter),new ItemStack(SignalIndustries.basicCrystalCutter),new ItemStack(SignalIndustries.reinforcedCrystalCutter)))); + public static RecipeGroupSI CRYSTAL_CHAMBER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicCrystalChamber)))); + public static RecipeGroupSI INFUSER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicInfuser)))); + public static RecipeGroupSI CENTRIFUGE = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.reinforcedCentrifuge)))); @Override public void onRecipesReady() { new SignalIndustriesFluidPlugin().initializePlugin(SignalIndustries.LOGGER); + load(); + MobInfoRegistry.register(EntityInfernal.class,"guidebook.section.mob.infernal.name", "guidebook.section.mob.infernal.desc",40,1000,new MobInfoRegistry.MobDrop[]{new MobInfoRegistry.MobDrop(new ItemStack(SignalIndustries.infernalFragment),1,0,2)}); + + } + + public static void resetGroups(){ + SIGNAL_INDUSTRIES = new RecipeNamespaceSI(); + WORKBENCH = new RecipeGroup<>(new RecipeSymbol(new ItemStack(Block.workbench))); + EXTRACTOR = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeExtractor), new ItemStack(SignalIndustries.basicExtractor), new ItemStack(SignalIndustries.reinforcedExtractor)))); + CRUSHER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrusher),new ItemStack(SignalIndustries.basicCrusher)))); + ALLOY_SMELTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeAlloySmelter),new ItemStack(SignalIndustries.basicAlloySmelter)))); + PLATE_FORMER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePlateFormer),new ItemStack(SignalIndustries.basicPlateFormer),new ItemStack(SignalIndustries.reinforcedPlateFormer)))); + PUMP = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypePump),new ItemStack(SignalIndustries.basicPump)))); + CRYSTAL_CUTTER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.prototypeCrystalCutter),new ItemStack(SignalIndustries.basicCrystalCutter),new ItemStack(SignalIndustries.reinforcedCrystalCutter)))); + CRYSTAL_CHAMBER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicCrystalChamber)))); + INFUSER = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.basicInfuser)))); + CENTRIFUGE = new RecipeGroupSI<>(new RecipeSymbol(Arrays.asList(new ItemStack(SignalIndustries.reinforcedCentrifuge)))); + } + + public static void load(){ Registries.RECIPE_TYPES.register("signalindustries:machine", RecipeEntryMachine.class); Registries.RECIPE_TYPES.register("signalindustries:machine/fluid", RecipeEntryMachineFluid.class); List abilityGroup = new ArrayList<>(); @@ -72,8 +92,7 @@ public void onRecipesReady() { SIGNAL_INDUSTRIES.register("infuser",INFUSER); SIGNAL_INDUSTRIES.register("centrifuge",CENTRIFUGE); Registries.RECIPES.register("signalindustries",SIGNAL_INDUSTRIES); - MobInfoRegistry.register(EntityInfernal.class,"guidebook.section.mob.infernal.name", "guidebook.section.mob.infernal.desc",40,1000,new MobInfoRegistry.MobDrop[]{new MobInfoRegistry.MobDrop(new ItemStack(SignalIndustries.infernalFragment),1,0,2)}); - DataLoader.loadRecipes("/assets/signalindustries/recipes/workbench.json"); + DataLoader.loadRecipesFromFile("/assets/signalindustries/recipes/workbench.json"); SignalIndustries.LOGGER.info(SIGNAL_INDUSTRIES.getAllRecipes().size()+" recipes in "+SIGNAL_INDUSTRIES.size()+" groups."); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/render/RenderItemsInConduit.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderItemsInConduit.java index ff39670a..5b6ceb6a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/render/RenderItemsInConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderItemsInConduit.java @@ -154,10 +154,6 @@ public void doRenderItem(ItemStack itemstack, double d, double d1, double d2, fl float f17 = (float)(k >> 8 & 0xFF) / 255.0f; float f19 = (float)(k & 0xFF) / 255.0f; float f21 = 1.0f; - //float f21 = entity.getBrightness(f1); - /*if (Minecraft.getMinecraft(this).fullbright || entity.item.getItem().hasTag(ItemTags.renderFullbright)) { - f21 = 1.0f; - }*/ GL11.glColor4f(f15 * f21, f17 * f21, f19 * f21, 1.0f); } /*if (Minecraft.getMinecraft(this).gameSettings.items3D.value) { diff --git a/src/main/java/sunsetsatellite/signalindustries/util/RenderMultiblockInGuidebook.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderMultiblockInGuidebook.java similarity index 97% rename from src/main/java/sunsetsatellite/signalindustries/util/RenderMultiblockInGuidebook.java rename to src/main/java/sunsetsatellite/signalindustries/render/RenderMultiblockInGuidebook.java index 71d120dc..5b9b5e51 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/RenderMultiblockInGuidebook.java +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderMultiblockInGuidebook.java @@ -1,4 +1,4 @@ -package sunsetsatellite.signalindustries.util; +package sunsetsatellite.signalindustries.render; import net.minecraft.client.render.FontRenderer; import net.minecraft.client.render.RenderEngine; diff --git a/src/main/java/sunsetsatellite/signalindustries/render/RenderSingleBlock.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderSingleBlock.java new file mode 100644 index 00000000..f8971f16 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderSingleBlock.java @@ -0,0 +1,860 @@ +package sunsetsatellite.signalindustries.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.render.RenderBlockCache; +import net.minecraft.client.render.Tessellator; +import net.minecraft.client.render.TextureFX; +import net.minecraft.core.block.Block; +import net.minecraft.core.util.helper.Side; +import net.minecraft.core.world.World; +import net.minecraft.core.world.WorldSource; + +import static net.minecraft.core.Global.TEXTURE_ATLAS_WIDTH_TILES; + +public class RenderSingleBlock { + + private WorldSource blockAccess; + private Minecraft mc; + private World world; + private final int overrideBlockTexture; + private final boolean flipTexture; + private final boolean renderAllFaces; + public static boolean fancyGrass = true; + + private static final float[] SIDE_LIGHT_MULTIPLIER = {0.5f, 1.f, 0.8f, 0.8f, 0.6f, 0.6f}; + public boolean useInventoryTint; + private final int uvRotateEast; + private final int uvRotateWest; + private final int uvRotateSouth; + private final int uvRotateNorth; + private final int uvRotateTop; + private final int uvRotateBottom; + private boolean enableAO; + private final int field_22352_G; + private float colorRedTopLeft; + private float colorRedBottomLeft; + private float colorRedBottomRight; + private float colorRedTopRight; + private float colorGreenTopLeft; + private float colorGreenBottomLeft; + private float colorGreenBottomRight; + private float colorGreenTopRight; + private float colorBlueTopLeft; + private float colorBlueBottomLeft; + private float colorBlueBottomRight; + private float colorBlueTopRight; + public boolean overbright; + + private RenderBlockCache cache = new RenderBlockCache(); + + public RenderSingleBlock(World world, WorldSource iblockaccess) + { + overrideBlockTexture = -1; + flipTexture = false; + renderAllFaces = false; + useInventoryTint = true; + uvRotateEast = 0; + uvRotateWest = 0; + uvRotateSouth = 0; + uvRotateNorth = 0; + uvRotateTop = 0; + uvRotateBottom = 0; + field_22352_G = 1; + blockAccess = iblockaccess; + this.world = world; + this.mc = Minecraft.getMinecraft(this); + } + + public RenderSingleBlock() + { + overrideBlockTexture = -1; + flipTexture = false; + renderAllFaces = false; + useInventoryTint = true; + uvRotateEast = 0; + uvRotateWest = 0; + uvRotateSouth = 0; + uvRotateNorth = 0; + uvRotateTop = 0; + uvRotateBottom = 0; + field_22352_G = 1; + this.mc = Minecraft.getMinecraft(this); + } + + public boolean renderStandardBlock(Block block, int x, int y, int z, int meta, float r, float g, float b) { + this.enableAO = true; + cache.setupCache(block, blockAccess, x, y, z); + boolean notGrass = block != Block.grass; + boolean somethingRendered = renderSide(block, x, y, z, r, g, b, notGrass,0, meta, + 0, -1, 0, (float)block.minY, + 0, 0, 1, (float)block.maxZ, (float)block.minZ, + -1, 0, 0, 1-(float)block.minX, 1-(float)block.maxX + ); + somethingRendered |= renderSide(block, x, y, z, r, g, b, notGrass,1, meta, + 0,1,0, 1-(float)block.maxY, + 0,0,1, (float)block.maxZ, (float)block.minZ, + 1,0,0, (float)block.maxX, (float)block.minX + ); + somethingRendered |= renderSide(block, x, y, z, r, g, b, notGrass,2, meta, + 0,0,-1, (float)block.minZ, + -1,0,0, 1-(float)block.minX, 1-(float)block.maxX, + 0,1,0, (float)block.maxY, (float)block.minY + ); + somethingRendered |= renderSide(block, x, y, z, r, g, b, notGrass,3, meta, + 0,0,1, 1-(float)block.maxZ, + 0,1,0, (float)block.maxY, (float)block.minY, + -1,0,0, 1-(float)block.minX, 1-(float)block.maxX + ); + somethingRendered |= renderSide(block, x, y, z, r, g, b, notGrass,4, meta, + -1,0,0, (float)block.minX, + 0,0,1, (float)block.maxZ, (float)block.minZ, + 0,1,0, (float)block.maxY, (float)block.minY + ); + somethingRendered |= renderSide(block, x, y, z, r, g, b, notGrass,5, meta, + 1,0,0, 1-(float)block.maxX, + 0,0,1, (float)block.maxZ, (float)block.minZ, + 0,-1,0, 1-(float)block.minY, 1-(float)block.maxY + ); + this.enableAO = false; + return somethingRendered; + } + + /** + * @author CyborgCabbage + * Thanks! :D + */ + final boolean renderSide(Block block, int x, int y, int z, float r, float g, float b, boolean notGrass, int side, int meta, + int dirX, int dirY, int dirZ, float depth, + int topX, int topY, int topZ, float topP, float botP, + int lefX, int lefY, int lefZ, float lefP, float rigP + ){ + boolean rendered = false; + boolean flag = (side == 1) || notGrass; + block.setBlockBoundsBasedOnSide(world, x, y, z, Side.getSideById(side)); + if (this.renderAllFaces || block.shouldSideBeRendered(this.blockAccess, x+dirX, y+dirY, z+dirZ, side, meta)) { + float lightTR; + float lightBR; + float lightBL; + float lightTL; + + if (this.overbright) { + lightTR = 1.0F; + lightBR = 1.0F; + lightBL = 1.0F; + lightTL = 1.0F; + } else if (this.field_22352_G <= 0) { + lightTL = lightBL = lightBR = lightTR = cache.getBrightness(dirX, dirY, dirZ); + } else { + if (mc.isAmbientOcclusionEnabled()) { + { + float dirB = cache.getBrightness(dirX, dirY, dirZ); + boolean lefT = cache.getOpacity(dirX + lefX, dirY + lefY, dirZ + lefZ); + boolean botT = cache.getOpacity(dirX - topX, dirY - topY, dirZ - topZ); + boolean topT = cache.getOpacity(dirX + topX, dirY + topY, dirZ + topZ); + boolean rigT = cache.getOpacity(dirX - lefX, dirY - lefY, dirZ - lefZ); + float lB = cache.getBrightness(dirX + lefX, dirY + lefY, dirZ + lefZ); + float bB = cache.getBrightness(dirX - topX, dirY - topY, dirZ - topZ); + float tB = cache.getBrightness(dirX + topX, dirY + topY, dirZ + topZ); + float rB = cache.getBrightness(dirX - lefX, dirY - lefY, dirZ - lefZ); + float blB = botT && lefT ? lB : cache.getBrightness(dirX + lefX - topX, dirY + lefY - topY, dirZ + lefZ - topZ); + float tlB = topT && lefT ? lB : cache.getBrightness(dirX + lefX + topX, dirY + lefY + topY, dirZ + lefZ + topZ); + float brB = botT && rigT ? rB : cache.getBrightness(dirX - lefX - topX, dirY - lefY - topY, dirZ - lefZ - topZ); + float trB = topT && rigT ? rB : cache.getBrightness(dirX - lefX + topX, dirY - lefY + topY, dirZ - lefZ + topZ); + lightTL = (tlB + lB + tB + dirB) / 4.0F; + lightTR = (tB + dirB + trB + rB) / 4.0F; + lightBR = (dirB + bB + rB + brB) / 4.0F; + lightBL = (lB + blB + dirB + bB) / 4.0F; + } + if(depth > 0.01){ + float dirB = cache.getBrightness(0, 0, 0); + boolean lefT = cache.getOpacity(lefX, lefY, lefZ); + boolean botT = cache.getOpacity(-topX, -topY, -topZ); + boolean topT = cache.getOpacity(topX, topY, topZ); + boolean rigT = cache.getOpacity(-lefX, -lefY, -lefZ); + float lB = cache.getBrightness(lefX, lefY, lefZ); + float bB = cache.getBrightness(-topX, -topY, -topZ); + float tB = cache.getBrightness(topX, topY, topZ); + float rB = cache.getBrightness(-lefX, -lefY, -lefZ); + float blB = botT && lefT ? lB : cache.getBrightness(lefX - topX, lefY - topY, lefZ - topZ); + float tlB = topT && lefT ? lB : cache.getBrightness(lefX + topX, lefY + topY, lefZ + topZ); + float brB = botT && rigT ? rB : cache.getBrightness(-lefX - topX, -lefY - topY, -lefZ - topZ); + float trB = topT && rigT ? rB : cache.getBrightness(-lefX + topX, -lefY + topY, -lefZ + topZ); + lightTL = (tlB + lB + tB + dirB) / 4.0F * depth + lightTL*(1-depth); + lightTR = (tB + dirB + trB + rB) / 4.0F * depth + lightTR*(1-depth); + lightBR = (dirB + bB + rB + brB) / 4.0F * depth + lightBR*(1-depth); + lightBL = (lB + blB + dirB + bB) / 4.0F * depth + lightBL*(1-depth); + } + } else { + float brightness = cache.getBrightness(dirX, dirY, dirZ); + lightTL = lightBL = lightBR = lightTR = brightness; + } + } + + if (overbright) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (flag ? r : 1.0F); + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (flag ? g : 1.0F); + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (flag ? b : 1.0F); + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (flag ? r : 1.0F) * SIDE_LIGHT_MULTIPLIER[side]; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (flag ? g : 1.0F) * SIDE_LIGHT_MULTIPLIER[side]; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (flag ? b : 1.0F) * SIDE_LIGHT_MULTIPLIER[side]; + } + float tl = topP * lightTL + (1 - topP) * lightBL; + float tr = topP * lightTR + (1 - topP) * lightBR; + float bl = botP * lightTL + (1 - botP) * lightBL; + float br = botP * lightTR + (1 - botP) * lightBR; + float ltl = lefP * tl + (1 - lefP) * tr; + float lbl = lefP * bl + (1 - lefP) * br; + float lbr = rigP * bl + (1 - rigP) * br; + float ltr = rigP * tl + (1 - rigP) * tr; + this.colorRedTopLeft *= ltl; + this.colorGreenTopLeft *= ltl; + this.colorBlueTopLeft *= ltl; + + this.colorRedBottomLeft *= lbl; + this.colorGreenBottomLeft *= lbl; + this.colorBlueBottomLeft *= lbl; + + this.colorRedBottomRight *= lbr; + this.colorGreenBottomRight *= lbr; + this.colorBlueBottomRight *= lbr; + + this.colorRedTopRight *= ltr; + this.colorGreenTopRight *= ltr; + this.colorBlueTopRight *= ltr; + + int tex; + if (this.overbright) { + tex = block.getBlockOverbrightTexture(this.blockAccess, x, y, z, side); + } else { + tex = block.getBlockTexture(this.blockAccess, x, y, z, Side.getSideById(side)); + } + + if (tex >= 0) { + if(side == 0) { + this.renderBottomFace(block, x, y, z, tex); + }else if(side == 1){ + this.renderTopFace(block, x, y, z, tex); + }else if(side == 2){ + this.renderNorthFace(block, x, y, z, tex); + }else if(side == 3){ + this.renderSouthFace(block, x, y, z, tex); + }else if(side == 4){ + this.renderWestFace(block, x, y, z, tex); + }else if(side == 5){ + this.renderEastFace(block, x, y, z, tex); + } + rendered = true; + } + if (fancyGrass && tex == 3 && this.overrideBlockTexture < 0) { + this.colorRedTopLeft *= r; + this.colorRedBottomLeft *= r; + this.colorRedBottomRight *= r; + this.colorRedTopRight *= r; + this.colorGreenTopLeft *= g; + this.colorGreenBottomLeft *= g; + this.colorGreenBottomRight *= g; + this.colorGreenTopRight *= g; + this.colorBlueTopLeft *= b; + this.colorBlueBottomLeft *= b; + this.colorBlueBottomRight *= b; + this.colorBlueTopRight *= b; + if(side == 2){ + this.renderNorthFace(block, x, y, z, Block.texCoordToIndex(6, 2)); + }else if(side == 3){ + this.renderSouthFace(block, x, y, z, Block.texCoordToIndex(6, 2)); + }else if(side == 4){ + this.renderWestFace(block, x, y, z, Block.texCoordToIndex(6, 2)); + }else if(side == 5){ + this.renderEastFace(block, x, y, z, Block.texCoordToIndex(6, 2)); + } + } + } + return rendered; + } + + public void renderBottomFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxX * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)k + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = (((double)k + block.maxZ * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(block.minX < 0.0D || block.maxX > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minZ < 0.0D || block.maxZ > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + if(uvRotateBottom == 2) + { + d3 = ((double)j + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } else + if(uvRotateBottom == 1) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + d3 = d7; + d4 = d8; + d9 = d6; + d10 = d5; + } else + if(uvRotateBottom == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + double d11 = d + block.minX; + double d12 = d + block.maxX; + double d13 = d1 + block.minY; + double d14 = d2 + block.minZ; + double d15 = d2 + block.maxZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } else + { + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } + } + + public void renderTopFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxX * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)k + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = (((double)k + block.maxZ * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(block.minX < 0.0D || block.maxX > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minZ < 0.0D || block.maxZ > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + if(uvRotateTop == 1) + { + d3 = ((double)j + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } else + if(uvRotateTop == 2) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + d3 = d7; + d4 = d8; + d9 = d6; + d10 = d5; + } else + if(uvRotateTop == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + double d11 = d + block.minX; + double d12 = d + block.maxX; + double d13 = d1 + block.maxY; + double d14 = d2 + block.minZ; + double d15 = d2 + block.maxZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } else + { + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } + } + + public void renderNorthFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxX * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(flipTexture) + { + double d7 = d3; + d3 = d4; + d4 = d7; + } + if(block.minX < 0.0D || block.maxX > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minY < 0.0D || block.maxY > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d8 = d4; + double d9 = d3; + double d10 = d5; + double d11 = d6; + if(uvRotateEast == 2) + { + d3 = ((double)j + block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d8 = d3; + d9 = d4; + d5 = d6; + d6 = d10; + } else + if(uvRotateEast == 1) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d3 = d8; + d4 = d9; + d10 = d6; + d11 = d5; + } else + if(uvRotateEast == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = (((double)k + block.minY * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + } + double d12 = d + block.minX; + double d13 = d + block.maxX; + double d14 = d1 + block.minY; + double d15 = d1 + block.maxY; + double d16 = d2 + block.minZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d12, d15, d16, d8, d10); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d13, d15, d16, d3, d5); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d13, d14, d16, d9, d11); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d12, d14, d16, d4, d6); + } else + { + tessellator.addVertexWithUV(d12, d15, d16, d8, d10); + tessellator.addVertexWithUV(d13, d15, d16, d3, d5); + tessellator.addVertexWithUV(d13, d14, d16, d9, d11); + tessellator.addVertexWithUV(d12, d14, d16, d4, d6); + } + } + + public void renderSouthFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxX * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(flipTexture) + { + double d7 = d3; + d3 = d4; + d4 = d7; + } + if(block.minX < 0.0D || block.maxX > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minY < 0.0D || block.maxY > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d8 = d4; + double d9 = d3; + double d10 = d5; + double d11 = d6; + if(uvRotateWest == 1) + { + d3 = ((double)j + block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d8 = d3; + d9 = d4; + d5 = d6; + d6 = d10; + } else + if(uvRotateWest == 2) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.maxX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d3 = d8; + d4 = d9; + d10 = d6; + d11 = d5; + } else + if(uvRotateWest == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minX * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxX * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = (((double)k + block.minY * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + } + double d12 = d + block.minX; + double d13 = d + block.maxX; + double d14 = d1 + block.minY; + double d15 = d1 + block.maxY; + double d16 = d2 + block.maxZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d12, d15, d16, d3, d5); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d12, d14, d16, d9, d11); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d13, d14, d16, d4, d6); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d13, d15, d16, d8, d10); + } else + { + tessellator.addVertexWithUV(d12, d15, d16, d3, d5); + tessellator.addVertexWithUV(d12, d14, d16, d9, d11); + tessellator.addVertexWithUV(d13, d14, d16, d4, d6); + tessellator.addVertexWithUV(d13, d15, d16, d8, d10); + } + } + + public void renderWestFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxZ * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(flipTexture) + { + double d7 = d3; + d3 = d4; + d4 = d7; + } + if(block.minZ < 0.0D || block.maxZ > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minY < 0.0D || block.maxY > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d8 = d4; + double d9 = d3; + double d10 = d5; + double d11 = d6; + if(uvRotateNorth == 1) + { + d3 = ((double)j + block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d8 = d3; + d9 = d4; + d5 = d6; + d6 = d10; + } else + if(uvRotateNorth == 2) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d3 = d8; + d4 = d9; + d10 = d6; + d11 = d5; + } else + if(uvRotateNorth == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = (((double)k + block.minY * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + } + double d12 = d + block.minX; + double d13 = d1 + block.minY; + double d14 = d1 + block.maxY; + double d15 = d2 + block.minZ; + double d16 = d2 + block.maxZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d12, d14, d16, d8, d10); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d12, d13, d15, d9, d11); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d12, d13, d16, d4, d6); + } else + { + tessellator.addVertexWithUV(d12, d14, d16, d8, d10); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.addVertexWithUV(d12, d13, d15, d9, d11); + tessellator.addVertexWithUV(d12, d13, d16, d4, d6); + } + } + + public void renderEastFace(Block block, double d, double d1, double d2, + int i) + { + Tessellator tessellator = Tessellator.instance; + if(overrideBlockTexture >= 0) + { + i = overrideBlockTexture; + } + int j = (i % TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain; + int k = (i / TEXTURE_ATLAS_WIDTH_TILES) * TextureFX.tileWidthTerrain;; + double d3 = ((double)j + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d4 = (((double)j + block.maxZ * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + double d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + if(flipTexture) + { + double d7 = d3; + d3 = d4; + d4 = d7; + } + if(block.minZ < 0.0D || block.maxZ > 1.0D) + { + d3 = ((float)j + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((float)j + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + if(block.minY < 0.0D || block.maxY > 1.0D) + { + d5 = ((float)k + 0.0F) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((float)k + (TextureFX.tileWidthTerrain - 0.01F)) / (float)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + } + double d8 = d4; + double d9 = d3; + double d10 = d5; + double d11 = d6; + if(uvRotateSouth == 2) + { + d3 = ((double)j + block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)(k + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)j + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)(k + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d8 = d3; + d9 = d4; + d5 = d6; + d6 = d10; + } else + if(uvRotateSouth == 1) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.minY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = ((double)k + block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + d3 = d8; + d4 = d9; + d10 = d6; + d11 = d5; + } else + if(uvRotateSouth == 3) + { + d3 = ((double)(j + TextureFX.tileWidthTerrain) - block.minZ * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d4 = ((double)(j + TextureFX.tileWidthTerrain) - block.maxZ * (double)TextureFX.tileWidthTerrain - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d5 = ((double)k + block.maxY * (double)TextureFX.tileWidthTerrain) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d6 = (((double)k + block.minY * (double)TextureFX.tileWidthTerrain) - 0.01D) / (double)(TextureFX.tileWidthTerrain * TEXTURE_ATLAS_WIDTH_TILES); + d8 = d4; + d9 = d3; + d10 = d5; + d11 = d6; + } + double d12 = d + block.maxX; + double d13 = d1 + block.minY; + double d14 = d1 + block.maxY; + double d15 = d2 + block.minZ; + double d16 = d2 + block.maxZ; + if(enableAO) + { + tessellator.setColorOpaque_F(colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft); + tessellator.addVertexWithUV(d12, d13, d16, d9, d11); + tessellator.setColorOpaque_F(colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight); + tessellator.addVertexWithUV(d12, d14, d15, d8, d10); + tessellator.setColorOpaque_F(colorRedTopRight, colorGreenTopRight, colorBlueTopRight); + tessellator.addVertexWithUV(d12, d14, d16, d3, d5); + } else + { + tessellator.addVertexWithUV(d12, d13, d16, d9, d11); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d14, d15, d8, d10); + tessellator.addVertexWithUV(d12, d14, d16, d3, d5); + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/util/PipeType.java b/src/main/java/sunsetsatellite/signalindustries/util/PipeType.java new file mode 100644 index 00000000..418b7054 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/util/PipeType.java @@ -0,0 +1,7 @@ +package sunsetsatellite.signalindustries.util; + +public enum PipeType { + NORMAL, + RESTRICT, + SENSOR +} diff --git a/src/main/java/sunsetsatellite/signalindustries/util/RecipeExtendedSymbol.java b/src/main/java/sunsetsatellite/signalindustries/util/RecipeExtendedSymbol.java index f683af55..7a577022 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/RecipeExtendedSymbol.java +++ b/src/main/java/sunsetsatellite/signalindustries/util/RecipeExtendedSymbol.java @@ -4,6 +4,7 @@ import net.minecraft.core.data.registry.recipe.RecipeSymbol; import net.minecraft.core.item.ItemStack; import sunsetsatellite.catalyst.fluids.util.FluidStack; +import turniplabs.halplibe.mixin.accessors.RecipeSymbolAccessor; import java.util.*; import java.util.stream.Collectors; @@ -151,7 +152,13 @@ public RecipeExtendedSymbol copy(){ } public RecipeSymbol asNormalSymbol(){ - return new RecipeSymbol(symbol,stack,itemGroup); + if(itemGroup == null){ + RecipeSymbol r = new RecipeSymbol(stack); + ((RecipeSymbolAccessor)r).setSymbol(symbol); + return r; + } else { + return new RecipeSymbol(symbol,stack,itemGroup); + } } public static RecipeExtendedSymbol[] arrayOf(Object... objs){ diff --git a/src/main/resources/assets/signalindustries/block/awakened_alloy_bricks.png b/src/main/resources/assets/signalindustries/block/awakened_alloy_bricks.png new file mode 100644 index 00000000..feb36f32 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/awakened_alloy_bricks.png differ diff --git a/src/main/resources/assets/signalindustries/block/cobblestone_bricks.png b/src/main/resources/assets/signalindustries/block/cobblestone_bricks.png new file mode 100644 index 00000000..94f4457d Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/cobblestone_bricks.png differ diff --git a/src/main/resources/assets/signalindustries/block/crystal_alloy_bricks.png b/src/main/resources/assets/signalindustries/block/crystal_alloy_bricks.png new file mode 100644 index 00000000..ba642dc6 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/crystal_alloy_bricks.png differ diff --git a/src/main/resources/assets/signalindustries/block/filterblue.png b/src/main/resources/assets/signalindustries/block/filter_blue.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filterblue.png rename to src/main/resources/assets/signalindustries/block/filter_blue.png diff --git a/src/main/resources/assets/signalindustries/block/filtercyan.png b/src/main/resources/assets/signalindustries/block/filter_cyan.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filtercyan.png rename to src/main/resources/assets/signalindustries/block/filter_cyan.png diff --git a/src/main/resources/assets/signalindustries/block/filtergreen.png b/src/main/resources/assets/signalindustries/block/filter_green.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filtergreen.png rename to src/main/resources/assets/signalindustries/block/filter_green.png diff --git a/src/main/resources/assets/signalindustries/block/filtermagenta.png b/src/main/resources/assets/signalindustries/block/filter_magenta.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filtermagenta.png rename to src/main/resources/assets/signalindustries/block/filter_magenta.png diff --git a/src/main/resources/assets/signalindustries/block/filterred.png b/src/main/resources/assets/signalindustries/block/filter_red.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filterred.png rename to src/main/resources/assets/signalindustries/block/filter_red.png diff --git a/src/main/resources/assets/signalindustries/block/filteryellow.png b/src/main/resources/assets/signalindustries/block/filter_yellow.png similarity index 100% rename from src/main/resources/assets/signalindustries/block/filteryellow.png rename to src/main/resources/assets/signalindustries/block/filter_yellow.png diff --git a/src/main/resources/assets/signalindustries/block/item_conduit_basic_restrict.png b/src/main/resources/assets/signalindustries/block/item_conduit_basic_restrict.png new file mode 100644 index 00000000..fa833b47 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/item_conduit_basic_restrict.png differ diff --git a/src/main/resources/assets/signalindustries/block/item_conduit_basic_sensor.png b/src/main/resources/assets/signalindustries/block/item_conduit_basic_sensor.png new file mode 100644 index 00000000..f2a741ed Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/item_conduit_basic_sensor.png differ diff --git a/src/main/resources/assets/signalindustries/block/item_conduit_prototype.png b/src/main/resources/assets/signalindustries/block/item_conduit_prototype.png new file mode 100644 index 00000000..dec35263 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/item_conduit_prototype.png differ diff --git a/src/main/resources/assets/signalindustries/block/reinforced_alloy_bricks.png b/src/main/resources/assets/signalindustries/block/reinforced_alloy_bricks.png new file mode 100644 index 00000000..90403532 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/reinforced_alloy_bricks.png differ diff --git a/src/main/resources/assets/signalindustries/block/reinforced_external_io_blank.png b/src/main/resources/assets/signalindustries/block/reinforced_external_io_blank.png new file mode 100644 index 00000000..e625377f Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/reinforced_external_io_blank.png differ diff --git a/src/main/resources/assets/signalindustries/block/reinforced_external_io_both.png b/src/main/resources/assets/signalindustries/block/reinforced_external_io_both.png new file mode 100644 index 00000000..a9b83ba3 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/reinforced_external_io_both.png differ diff --git a/src/main/resources/assets/signalindustries/block/reinforced_external_io_input.png b/src/main/resources/assets/signalindustries/block/reinforced_external_io_input.png new file mode 100644 index 00000000..3b723c08 Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/reinforced_external_io_input.png differ diff --git a/src/main/resources/assets/signalindustries/block/reinforced_external_io_output.png b/src/main/resources/assets/signalindustries/block/reinforced_external_io_output.png new file mode 100644 index 00000000..5f9a550b Binary files /dev/null and b/src/main/resources/assets/signalindustries/block/reinforced_external_io_output.png differ diff --git a/src/main/resources/assets/signalindustries/blockstates/basic_item_conduit_restrict.json b/src/main/resources/assets/signalindustries/blockstates/basic_item_conduit_restrict.json new file mode 100644 index 00000000..47b8a58e --- /dev/null +++ b/src/main/resources/assets/signalindustries/blockstates/basic_item_conduit_restrict.json @@ -0,0 +1,134 @@ +{ + "multipart": [ + { + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_base" + } + }, + { + "when": { + "AND": [ + {"up": "true"},{"restrict_up": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_up" + } + }, + { + "when": { + "AND": [ + {"up": "true"},{"restrict_up": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_up" + } + }, + + { + "when": { + "AND": [ + {"down": "true"},{"restrict_down": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_down" + } + }, + { + "when": { + "AND": [ + {"down": "true"},{"restrict_down": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_down" + } + }, + + { + "when": { + "AND": [ + {"north": "true"},{"restrict_north": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_north" + } + }, + { + "when": { + "AND": [ + {"north": "true"},{"restrict_north": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_north" + } + }, + + { + "when": { + "AND": [ + {"south": "true"},{"restrict_south": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_south" + } + }, + { + "when": { + "AND": [ + {"south": "true"},{"restrict_south": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_south" + } + }, + + { + "when": { + "AND": [ + {"east": "true"},{"restrict_east": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_east" + } + }, + { + "when": { + "AND": [ + {"east": "true"},{"restrict_east": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_east" + } + }, + + { + "when": { + "AND": [ + {"west": "true"},{"restrict_west": "true"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/restrict/conduit_west" + } + }, + { + "when": { + "AND": [ + {"west": "true"},{"restrict_west": "false"} + ] + }, + "apply": { + "model": "signalindustries:conduit/item/basic/conduit_west" + } + } + ] +} diff --git a/src/main/resources/assets/signalindustries/blockstates/prototype_item_conduit.json b/src/main/resources/assets/signalindustries/blockstates/prototype_item_conduit.json new file mode 100644 index 00000000..c6f49398 --- /dev/null +++ b/src/main/resources/assets/signalindustries/blockstates/prototype_item_conduit.json @@ -0,0 +1,57 @@ +{ + "multipart": [ + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_base" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_up" + }, + "when": { + "up": "true" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_down" + }, + "when": { + "down": "true" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_north" + }, + "when": { + "north": "true" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_east" + }, + "when": { + "east": "true" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_south" + }, + "when": { + "south": "true" + } + }, + { + "apply": { + "model": "signalindustries:conduit/item/prototype/conduit_west" + }, + "when": { + "west": "true" + } + } + ] +} diff --git a/src/main/resources/assets/signalindustries/gui/filter.png b/src/main/resources/assets/signalindustries/gui/filter.png index 090228da..b94155f1 100644 Binary files a/src/main/resources/assets/signalindustries/gui/filter.png and b/src/main/resources/assets/signalindustries/gui/filter.png differ diff --git a/src/main/resources/assets/signalindustries/item/position_chip.png b/src/main/resources/assets/signalindustries/item/position_chip.png new file mode 100644 index 00000000..a177ce34 Binary files /dev/null and b/src/main/resources/assets/signalindustries/item/position_chip.png differ diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_all.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_all.json new file mode 100644 index 00000000..d5568e88 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_all.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_all", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_base.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_base.json new file mode 100644 index 00000000..622b9c8b --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_base.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_base", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_down.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_down.json new file mode 100644 index 00000000..d12a43d0 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_down.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_down", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_east.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_east.json new file mode 100644 index 00000000..63876afc --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_east.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_east", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_north.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_north.json new file mode 100644 index 00000000..06923b59 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_north.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_north", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_south.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_south.json new file mode 100644 index 00000000..bc531534 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_south.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_south", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_up.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_up.json new file mode 100644 index 00000000..8257eab0 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_up.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_up", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_west.json b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_west.json new file mode 100644 index 00000000..bd765eeb --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/basic/restrict/conduit_west.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_west", + "textures": { + "conduit": "signalindustries:block/item_conduit_basic_restrict" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_all.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_all.json new file mode 100644 index 00000000..57885fd9 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_all.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_all", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_base.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_base.json new file mode 100644 index 00000000..9a8a46b3 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_base.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_base", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_down.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_down.json new file mode 100644 index 00000000..7bf0094c --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_down.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_down", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_east.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_east.json new file mode 100644 index 00000000..9fe15bdf --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_east.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_east", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_north.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_north.json new file mode 100644 index 00000000..96c7466c --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_north.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_north", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_south.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_south.json new file mode 100644 index 00000000..2b03e676 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_south.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_south", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_up.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_up.json new file mode 100644 index 00000000..2d73d5b3 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_up.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_up", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_west.json b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_west.json new file mode 100644 index 00000000..c42de763 --- /dev/null +++ b/src/main/resources/assets/signalindustries/model/conduit/item/prototype/conduit_west.json @@ -0,0 +1,6 @@ +{ + "parent": "signalindustries:conduit/template_item_conduit_west", + "textures": { + "conduit": "signalindustries:block/item_conduit_prototype" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/signalindustries/recipes/workbench.json b/src/main/resources/assets/signalindustries/recipes/workbench.json index 85a01177..bf89cd04 100644 --- a/src/main/resources/assets/signalindustries/recipes/workbench.json +++ b/src/main/resources/assets/signalindustries/recipes/workbench.json @@ -12,7 +12,7 @@ "symbol": "I", "stack": { "key": "item.ingot.iron", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -20,14 +20,14 @@ "symbol": "S", "stack": { "key": "item.stick", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "item.signalindustries.ironPlateHammer", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -45,14 +45,14 @@ "symbol": "D", "stack": { "key": "item.diamond", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "item.signalindustries.diamondCuttingGear", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -196,14 +196,14 @@ "symbol": "D", "stack": { "key": "item.signalindustries.dilithiumShard", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.dilithiumBlock", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -221,14 +221,14 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.rawCrystalBlock", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -246,14 +246,14 @@ "symbol": "C", "stack": { "key": "item.signalindustries.crystalAlloyIngot", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.emptyCrystalBlock", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -271,7 +271,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -279,7 +279,7 @@ "symbol": "C", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -287,14 +287,14 @@ "symbol": "P", "stack": { "key": "item.signalindustries.stonePlate", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -312,7 +312,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.signalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -320,7 +320,7 @@ "symbol": "C", "stack": { "key": "item.signalindustries.crystalAlloyPlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -328,14 +328,14 @@ "symbol": "P", "stack": { "key": "item.signalindustries.steelPlate", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.basic.machine", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -353,7 +353,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.saturatedSignalumAlloyIngot", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -361,7 +361,7 @@ "symbol": "R", "stack": { "key": "item.signalindustries.reinforcedCrystalAlloyPlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -369,14 +369,14 @@ "symbol": "B", "stack": { "key": "tile.signalindustries.basic.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.reinforced.machine", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -394,7 +394,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -402,7 +402,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -410,7 +410,7 @@ "symbol": "F", "stack": { "key": "tile.furnace.stone.idle", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -418,14 +418,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.extractor", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -443,7 +443,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -451,7 +451,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -459,7 +459,7 @@ "symbol": "F", "stack": { "key": "item.flint", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -467,14 +467,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.crusher", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -492,7 +492,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.steelPlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -500,7 +500,7 @@ "symbol": "B", "stack": { "key": "tile.furnace.blast.idle", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -508,14 +508,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.alloySmelter", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -533,7 +533,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -541,7 +541,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -549,7 +549,7 @@ "symbol": "H", "stack": { "key": "item.signalindustries.ironPlateHammer", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -557,14 +557,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.plateFormer", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": true @@ -680,7 +680,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.stonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -688,7 +688,7 @@ "symbol": "C", "stack": { "key": "tile.signalindustries.prototype.conduit.fluid", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -696,7 +696,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -704,7 +704,7 @@ "symbol": "B", "stack": { "key": "item.bucket", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -712,14 +712,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.pump", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -737,7 +737,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -745,7 +745,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -753,7 +753,7 @@ "symbol": "G", "stack": { "key": "item.signalindustries.diamondCuttingGear", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -761,14 +761,14 @@ "symbol": "M", "stack": { "key": "tile.signalindustries.prototype.machine", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.crystalCutter", - "amount": 1, + "amount": 1, "meta": 0 }, "consumeContainers": false @@ -786,7 +786,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.rawSignalumCrystal", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -794,7 +794,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.stonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -802,14 +802,14 @@ "symbol": "G", "stack": { "key": "tile.glass", - "amount": 1, + "amount": 1, "meta": 0 } } ], "result": { "key": "tile.signalindustries.prototype.conduit", - "amount": 4, + "amount": 4, "meta": 0 }, "consumeContainers": false @@ -827,7 +827,7 @@ "symbol": "S", "stack": { "key": "item.signalindustries.stonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -835,7 +835,7 @@ "symbol": "P", "stack": { "key": "item.signalindustries.cobblestonePlate", - "amount": 1, + "amount": 1, "meta": 0 } }, @@ -1578,8 +1578,8 @@ "type": "minecraft:crafting/shaped", "pattern": [ "PIP", - "IMI", - "PIP" + "FMI", + "PFP" ], "symbols": [ { @@ -1605,6 +1605,14 @@ "amount": 1, "meta": 0 } + }, + { + "symbol": "F", + "stack": { + "key": "item.signalindustries.fluidManipulationCircuit", + "amount": 1, + "meta": 0 + } } ], "result": { @@ -1614,6 +1622,55 @@ }, "consumeContainers": false }, + { + "name": "signalindustries:workbench/reinforced_external_io", + "type": "minecraft:crafting/shaped", + "pattern": [ + "PIP", + "FMI", + "PFP" + ], + "symbols": [ + { + "symbol": "P", + "stack": { + "key": "item.signalindustries.reinforcedCrystalAlloyPlate", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "M", + "stack": { + "key": "tile.signalindustries.reinforced.machine", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "I", + "stack": { + "key": "item.signalindustries.itemManipulationCircuit", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "F", + "stack": { + "key": "item.signalindustries.fluidManipulationCircuit", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.reinforced.externalIO", + "amount": 1, + "meta": 0 + }, + "consumeContainers": false + }, { "name": "signalindustries:workbench/basic_crystal_cutter", "type": "minecraft:crafting/shaped", @@ -2719,6 +2776,39 @@ }, "consumeContainers": false }, + { + "name": "signalindustries:workbench/basic_item_conduit", + "type": "minecraft:crafting/shaped", + "pattern": [ + "CGC", + " ", + "CGC" + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.crystalAlloyIngot", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "G", + "stack": { + "key": "tile.glass", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.basic.conduit.item", + "amount": 4, + "meta": 0 + }, + "consumeContainers": false + }, { "name": "signalindustries:workbench/prototype_goggles", "type": "minecraft:crafting/shaped", @@ -3232,6 +3322,63 @@ }, "consumeContainers": false }, + { + "name": "signalindustries:workbench/redstone_booster", + "type": "minecraft:crafting/shaped", + "pattern": [ + "RBR", + "RMR", + "DCD" + ], + "symbols": [ + { + "symbol": "M", + "stack": { + "key": "tile.signalindustries.basic.machine", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "D", + "stack": { + "key": "item.signalindustries.basicEnergyCore", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "R", + "stack": { + "key": "item.signalindustries.crystalAlloyPlate", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "B", + "stack": { + "key": "tile.block.redstone", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "C", + "stack": { + "key": "tile.torch.redstone.active", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.basic.booster", + "amount": 1, + "meta": 0 + }, + "consumeContainers": false + }, { "name": "signalindustries:workbench/dilithium_stabilizer", "type": "minecraft:crafting/shaped", @@ -4483,5 +4630,203 @@ "meta": 0 }, "consumeContainers": false + }, + { + "name": "signalindustries:workbench/position_memory_chip", + "type": "minecraft:crafting/shaped", + "pattern": [ + "D", + "C" + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.romChip.blank", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "D", + "stack": { + "key": "item.signalindustries.dimensionalChip", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "item.signalindustries.romChip.position", + "amount": 1, + "meta": 0 + }, + "consumeContainers": false + }, + { + "name": "signalindustries:workbench/cobblestone_bricks", + "type": "minecraft:crafting/shaped", + "pattern": [ + "CC", + "CC" + ], + "symbols": [ + { + "symbol": "C", + "group": "minecraft:cobblestones" + } + ], + "result": { + "key": "tile.signalindustries.prototype.bricks", + "amount": 4, + "meta": 0 + }, + "consumeContainers": false + }, + { + "name": "signalindustries:workbench/crystal_alloy_bricks", + "type": "minecraft:crafting/shaped", + "pattern": [ + "CC", + "CC" + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.crystalAlloyIngot", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.basic.bricks", + "amount": 8, + "meta": 0 + }, + "consumeContainers": false + }, + { + "name": "signalindustries:workbench/reinforced_crystal_alloy_bricks", + "type": "minecraft:crafting/shaped", + "pattern": [ + "CC", + "CC" + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.reinforcedCrystalAlloyIngot", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.reinforced.bricks", + "amount": 8, + "meta": 0 + }, + "consumeContainers": false + }, + { + "name": "signalindustries:workbench/prototype_inserter", + "type": "minecraft:crafting/shaped", + "pattern": [ + "CIC", + "SMS", + "C C" + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.cobblestonePlate", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "S", + "stack": { + "key": "item.signalindustries.stonePlate", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "M", + "stack": { + "key": "tile.signalindustries.prototype.machine", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "I", + "stack": { + "key": "item.signalindustries.itemManipulationCircuit", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.prototype.inserter", + "amount": 1, + "meta": 0 + }, + "consumeContainers": false + }, + { + "name": "signalindustries:workbench/basic_inserter", + "type": "minecraft:crafting/shaped", + "pattern": [ + " I ", + "CMC", + " P " + ], + "symbols": [ + { + "symbol": "C", + "stack": { + "key": "item.signalindustries.crystalAlloyPlate", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "M", + "stack": { + "key": "tile.signalindustries.basic.machine", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "I", + "stack": { + "key": "tile.signalindustries.prototype.inserter", + "amount": 1, + "meta": 0 + } + }, + { + "symbol": "P", + "stack": { + "key": "tile.signalindustries.basic.conduit.item", + "amount": 1, + "meta": 0 + } + } + ], + "result": { + "key": "tile.signalindustries.basic.inserter", + "amount": 1, + "meta": 0 + }, + "consumeContainers": false } ] \ No newline at end of file diff --git a/src/main/resources/credits.txt b/src/main/resources/credits.txt index c7bf7736..ad739ae2 100644 --- a/src/main/resources/credits.txt +++ b/src/main/resources/credits.txt @@ -7,6 +7,7 @@ theMidford - ideas, emotional support, icons watermelonMojito - automatic miner texture felix170905 - connected textures code mzov - basic tier texture remakes +sillydot - brick textures, reinforced infuser texture --Libraries/Mods integrated-- azurelmao - halplibe diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index d0f81f4d..8f19547a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -23,7 +23,8 @@ "azurelmao", "toufouMaster", "samuelDeboni", - "useless" + "useless", + "sillydot" ], "environment": "*", "entrypoints": { @@ -36,9 +37,6 @@ "recipesReady": [ "sunsetsatellite.signalindustries.recipes.container.SIRecipes" ], - "btwaila": [ - "sunsetsatellite.signalindustries.api.impl.btwaila.BTWailaSIPlugin" - ], "terrain-api": [ "sunsetsatellite.signalindustries.api.impl.terrainapi.TerrainAPISignalIndustriesPlugin" ] diff --git a/src/main/resources/lang/signalindustries/en_US.lang b/src/main/resources/lang/signalindustries/en_US.lang index a516f3db..5ad01991 100644 --- a/src/main/resources/lang/signalindustries/en_US.lang +++ b/src/main/resources/lang/signalindustries/en_US.lang @@ -81,6 +81,8 @@ item.signalindustries.romChip.boost.name=ROM Chip: Boost item.signalindustries.romChip.boost.desc=Contains code for a [Trigger] ability. item.signalindustries.romChip.blank.name=Blank ROM Chip item.signalindustries.romChip.blank.desc=Unprogrammed ROM chip. +item.signalindustries.romChip.position.name=Position Memory Chip +item.signalindustries.romChip.position.desc=Stores an XYZ location in the current world, unlike the [Warp Orb] it can only be used to logically link 2 points together. item.signalindustries.reinforced.pulsar.name=The Pulsar item.signalindustries.reinforced.pulsar.desc=An energy weapon capable of focusing [Signalum Energy] either outwards into a powerful shockwave or inwards to break a slotted item inside. @@ -158,15 +160,21 @@ tile.signalindustries.basic.conduit.fluid.desc=Transfers fluids, not suitable fo tile.signalindustries.reinforced.conduit.fluid.name=Reinforced Fluid Conduit tile.signalindustries.reinforced.conduit.fluid.desc=Transfers fluids, not suitable for [Signalum Energy]. +tile.signalindustries.prototype.conduit.item.name=Prototype Item Conduit +tile.signalindustries.prototype.conduit.item.desc=Transfers items. tile.signalindustries.basic.conduit.item.name=Basic Item Conduit -tile.signalindustries.basic.conduit.item.desc=Transfers items. +tile.signalindustries.basic.conduit.item.desc=Transfers items faster. +tile.signalindustries.basic.conduit.item.restrict.name=Basic Restrict Item Conduit +tile.signalindustries.basic.conduit.item.restrict.desc=Transfers items faster. Can have some of its directions blocked off preventing incoming items from going into that direction. tile.signalindustries.prototype.inserter.name=Prototype Inserter tile.signalindustries.prototype.inserter.desc=Picks up items from the ground and inserts them into item conduits. - tile.signalindustries.basic.inserter.name=Basic Inserter tile.signalindustries.basic.inserter.desc=Picks up more items from the ground faster and inserts them into item conduits. +tile.signalindustries.prototype.filter.name=Prototype Filter +tile.signalindustries.prototype.filter.desc=Sorts items that pass through it into colored outputs, + item.signalindustries.basic.prototypeHarness.name=Signalum Prototype Harness item.signalindustries.basic.prototypeHarness.desc=Provides little to no armor, but allows you to start using [Signalum Energy] on the go. item.signalindustries.basic.prototypeHarnessGoggles.name=Prototype Goggles @@ -415,6 +423,8 @@ tile.signalindustries.awakened.automaticMiner.name=Can mine out whole worlds acr tile.signalindustries.basic.externalIO.name=External I/O tile.signalindustries.basic.externalIO.desc=Allows item/fluid I/O configuration even for blocks that don't support it natively. +tile.signalindustries.reinforced.externalIO.name=Reinforced External I/O +tile.signalindustries.reinforced.externalIO.desc=Allows item/fluid I/O configuration even for blocks that don't support it natively, remotely! tile.signalindustries.basic.programmer.name=EEPROM Programmer tile.signalindustries.basic.programmer.desc=Device for programming and configuring [Triggers]. @@ -464,6 +474,15 @@ tile.signalindustries.awakenedSignalumCrystalBlock.desc=A solid block of Awakene tile.signalindustries.dilithiumCrystalBlock.name=Dilithium Crystal Block tile.signalindustries.dilithiumCrystalBlock.desc=A fragile crystal of Dilithium. +tile.signalindustries.prototype.bricks.name=Cobblestone Bricks +tile.signalindustries.prototype.bricks.desc=Stacked bricks of cobblestone. +tile.signalindustries.basic.bricks.name=Crystal Alloy Bricks +tile.signalindustries.basic.bricks.desc=Stacked bricks of Crystal Alloy ingots. +tile.signalindustries.reinforced.bricks.name=Reinforced Crystal Alloy Bricks +tile.signalindustries.reinforced.bricks.desc=Stacked bricks of Reinforced Crystal Alloy ingots. +tile.signalindustries.awakened.bricks.name=Awakened Alloy Bricks +tile.signalindustries.awakened.bricks.desc=Stacked bricks of Awakened Alloy ingots. + dimension.signalindustries.eternity.name=Eternity signalindustries.eternity.name=Eternity signalindustries.eternity.desc=The void between worlds\nconnected through the fabric of reality.\nHaving an active link to one of these worlds is the only way out.