From 8f31795a9c93a014e5b06a3eed91fd9de5852984 Mon Sep 17 00:00:00 2001 From: MartinSVK12 <37455793+MartinSVK12@users.noreply.github.com> Date: Sat, 16 Sep 2023 13:22:14 +0200 Subject: [PATCH] BTWaila integration shows fluids now. Added Automatic Miner. Added External I/O. Added Reinforced Casings. Added Reinforced Glass (with connected textures!). Added Signalum Drills (Basic & Reinforced). New worldgen for Eternity dim. First achievements. Arrows shot from blood moon enraged monsters deal the proper amount of damage now. Other small fixes. --- build.gradle | 42 +- gradle.properties | 4 +- .../signalindustries/SignalIndustries.java | 443 +++--- .../api/impl/btwaila/BTWailaSIPlugin.java | 2 + .../impl/btwaila/tooltips/EnergyTooltip.java | 62 +- .../impl/btwaila/tooltips/FluidTooltip.java | 54 + .../fluidapi/SignalIndustriesFluidPlugin.java | 9 +- .../ContainerGuidebookAlloySmelterRecipe.java | 4 +- .../handlers/RecipeHandlerCraftingSI.java | 7 +- .../blocks/BlockAlloySmelter.java | 22 +- .../blocks/BlockAutoMiner.java | 86 ++ .../signalindustries/blocks/BlockBreaker.java | 2 +- .../blocks/BlockConnectedTexture.java | 1239 +++++++++++++++++ .../signalindustries/blocks/BlockCrusher.java | 26 +- .../blocks/BlockCrystalChamber.java | 22 +- .../blocks/BlockCrystalCutter.java | 22 +- .../blocks/BlockDilithiumBooster.java | 27 +- .../blocks/BlockDilithiumCrystal.java | 41 + .../blocks/BlockDilithiumStabilizer.java | 30 +- .../blocks/BlockDimensionalAnchor.java | 37 +- .../blocks/BlockEternalTreeLog.java | 3 + .../blocks/BlockExternalIO.java | 67 + .../blocks/BlockExtractor.java | 25 +- .../signalindustries/blocks/BlockInfuser.java | 22 +- .../blocks/BlockPlateFormer.java | 22 +- .../signalindustries/blocks/BlockPump.java | 29 +- .../containers/ContainerAutoMiner.java | 40 + .../containers/ContainerExternalIO.java | 49 + .../dim/ChunkDecoratorEternity.java | 41 + .../dim/ChunkGeneratorEternity.java | 12 + .../dim/SurfaceGeneratorEternity.java | 11 + .../dim/WorldTypeEternity.java | 111 ++ .../entities/EntityCrystal.java | 32 +- .../entities/ExplosionEnergy.java | 5 +- .../signalindustries/gui/GuiAutoMiner.java | 143 ++ .../signalindustries/gui/GuiExternalIO.java | 141 ++ .../gui/GuiFluidIOConfig.java | 4 +- .../signalindustries/gui/GuiItemIOConfig.java | 4 +- .../interfaces/mixins/IKeybinds.java | 2 + .../inventories/InventoryPulsar.java | 2 +- .../inventories/TileEntityAlloySmelter.java | 1 + .../inventories/TileEntityAutoMiner.java | 143 ++ .../inventories/TileEntityCrusher.java | 1 + .../inventories/TileEntityCrystalChamber.java | 15 +- .../inventories/TileEntityCrystalCutter.java | 5 + .../TileEntityDimensionalAnchor.java | 6 +- .../inventories/TileEntityExternalIO.java | 225 +++ .../inventories/TileEntityExtractor.java | 1 + .../inventories/TileEntityInfuser.java | 5 + .../inventories/TileEntityPlateFormer.java | 7 +- .../inventories/TileEntityPump.java | 5 + .../inventories/TileEntityTieredMachine.java | 24 +- .../signalindustries/items/ItemPulsar.java | 40 +- .../items/ItemSignalumCrystal.java | 58 +- .../items/ItemSignalumDrill.java | 232 +++ .../items/ItemSignalumPrototypeHarness.java | 14 +- .../items/ItemSignalumSaber.java | 38 +- .../signalindustries/items/ItemTrigger.java | 16 +- .../signalindustries/items/ItemWarpOrb.java | 2 +- .../misc/SignalIndustriesAchievementPage.java | 63 + .../mixin/AchievementMixin.java | 28 + .../mixin/ChunkDecoratorOverworldMixin.java | 8 +- .../mixin/EntityArrowMixin.java | 31 + .../mixin/GameSettingsMixin.java | 8 + .../mixin/MinecraftMixin.java | 62 +- .../mixin/RenderBlocksMixin.java | 2 +- .../mixin/RenderGlobalMixin.java | 113 ++ .../mixin/RenderPlayerMixin.java | 2 +- .../signalindustries/mixin/WorldMixin.java | 8 +- .../accessors/GuiBlockOverlayAccessor.java | 18 - .../mp/packets/PacketOpenMachineGUI.java | 5 +- .../render/RenderAutoMiner.java | 336 +++++ .../{util => render}/RenderConduit.java | 2 +- .../render/RenderFluidInBlock.java | 58 + .../RenderFluidInConduit.java | 4 +- .../signalindustries/util/BlockTexture.java | 118 ++ .../signalindustries/util/NBTHelper.java | 12 +- .../signalindustries/util/NumberUtil.java | 2 +- .../WorldFeatureDilithiumCrystal.java | 113 ++ .../worldgen/WorldFeatureEternalTree.java | 378 +++++ .../worldgen/WorldFeatureObelisk.java | 71 + src/main/resources/achievements.txt | 115 ++ .../block/awakened_crystal_block.png | Bin 0 -> 723 bytes .../block/dilithium_block.png | Bin 0 -> 668 bytes .../block/dilithium_crystal_block.png | Bin 0 -> 607 bytes ...hor_top.png => dimensional_anchor_top.png} | Bin ...ng => dimensional_anchor_top_inactive.png} | Bin .../block/empty_crystal_block.png | Bin 0 -> 548 bytes .../block/external_io_blank.png | Bin 0 -> 421 bytes .../block/external_io_both.png | Bin 0 -> 379 bytes .../block/external_io_input.png | Bin 0 -> 375 bytes .../block/external_io_output.png | Bin 0 -> 375 bytes .../block/reinforced_casing.png | Bin 0 -> 304 bytes .../block/reinforced_glass.png | Bin 0 -> 344 bytes .../block/reinforced_glass_bottom.png | Bin 0 -> 178 bytes .../block/reinforced_glass_bottom_left.png | Bin 0 -> 259 bytes .../block/reinforced_glass_bottom_right.png | Bin 0 -> 255 bytes .../block/reinforced_glass_center.png | Bin 0 -> 126 bytes .../block/reinforced_glass_left.png | Bin 0 -> 198 bytes .../block/reinforced_glass_left_right.png | Bin 0 -> 283 bytes .../block/reinforced_glass_no_bottom.png | Bin 0 -> 312 bytes .../block/reinforced_glass_no_left.png | Bin 0 -> 296 bytes .../block/reinforced_glass_no_right.png | Bin 0 -> 285 bytes .../block/reinforced_glass_no_top.png | Bin 0 -> 316 bytes .../block/reinforced_glass_right.png | Bin 0 -> 190 bytes .../block/reinforced_glass_top.png | Bin 0 -> 170 bytes .../block/reinforced_glass_top_bottom.png | Bin 0 -> 214 bytes .../block/reinforced_glass_top_left.png | Bin 0 -> 249 bytes .../block/reinforced_glass_top_right.png | Bin 0 -> 261 bytes .../block/saturated_crystal_block.png | Bin 0 -> 664 bytes .../assets/signalindustries/gui/autominer.png | Bin 0 -> 5673 bytes .../signalindustries/gui/basic_gui_blank.png | Bin 0 -> 6059 bytes .../item/clockworkability.png | Bin 0 -> 478 bytes .../signalindustries/item/infernaleye.png | Bin 0 -> 636 bytes .../item/infernalfragment.png | Bin 0 -> 593 bytes .../signalindustries/item/signalum_drill.png | Bin 0 -> 419 bytes .../item/signalum_drill_awakened.png | Bin 0 -> 464 bytes .../item/signalum_drill_reinforced.png | Bin 0 -> 413 bytes ...colorizer.png => blood_moon_colorizer.png} | Bin .../assets/signalindustries/mob/infernal.png | Bin 0 -> 2574 bytes .../structures/dimensionalAnchor.nbt | Bin 535 -> 436 bytes src/main/resources/fabric.mod.json | 2 +- .../lang/signalindustries/en_US.lang | 58 +- .../lang/signalindustries/pl_PL.lang | 2 - .../resources/signalindustries.mixins.json | 3 +- 125 files changed, 4792 insertions(+), 614 deletions(-) create mode 100644 src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/FluidTooltip.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/blocks/BlockAutoMiner.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/blocks/BlockConnectedTexture.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumCrystal.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/containers/ContainerAutoMiner.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/containers/ContainerExternalIO.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/dim/ChunkDecoratorEternity.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/dim/ChunkGeneratorEternity.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/dim/SurfaceGeneratorEternity.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/dim/WorldTypeEternity.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAutoMiner.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumDrill.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/misc/SignalIndustriesAchievementPage.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java delete mode 100644 src/main/java/sunsetsatellite/signalindustries/mixin/accessors/GuiBlockOverlayAccessor.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/render/RenderAutoMiner.java rename src/main/java/sunsetsatellite/signalindustries/{util => render}/RenderConduit.java (98%) create mode 100644 src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInBlock.java rename src/main/java/sunsetsatellite/signalindustries/{util => render}/RenderFluidInConduit.java (98%) create mode 100644 src/main/java/sunsetsatellite/signalindustries/util/BlockTexture.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureDilithiumCrystal.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureEternalTree.java create mode 100644 src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureObelisk.java create mode 100644 src/main/resources/achievements.txt create mode 100644 src/main/resources/assets/signalindustries/block/awakened_crystal_block.png create mode 100644 src/main/resources/assets/signalindustries/block/dilithium_block.png create mode 100644 src/main/resources/assets/signalindustries/block/dilithium_crystal_block.png rename src/main/resources/assets/signalindustries/block/{dimension_anchor_top.png => dimensional_anchor_top.png} (100%) rename src/main/resources/assets/signalindustries/block/{dimension_anchor_top_inactive.png => dimensional_anchor_top_inactive.png} (100%) create mode 100644 src/main/resources/assets/signalindustries/block/empty_crystal_block.png create mode 100644 src/main/resources/assets/signalindustries/block/external_io_blank.png create mode 100644 src/main/resources/assets/signalindustries/block/external_io_both.png create mode 100644 src/main/resources/assets/signalindustries/block/external_io_input.png create mode 100644 src/main/resources/assets/signalindustries/block/external_io_output.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_casing.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_bottom.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_left.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_right.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_center.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_left.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_left_right.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_no_bottom.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_no_left.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_no_right.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_no_top.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_right.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_top.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_top_bottom.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_top_left.png create mode 100644 src/main/resources/assets/signalindustries/block/reinforced_glass_top_right.png create mode 100644 src/main/resources/assets/signalindustries/block/saturated_crystal_block.png create mode 100644 src/main/resources/assets/signalindustries/gui/autominer.png create mode 100644 src/main/resources/assets/signalindustries/gui/basic_gui_blank.png create mode 100644 src/main/resources/assets/signalindustries/item/clockworkability.png create mode 100644 src/main/resources/assets/signalindustries/item/infernaleye.png create mode 100644 src/main/resources/assets/signalindustries/item/infernalfragment.png create mode 100644 src/main/resources/assets/signalindustries/item/signalum_drill.png create mode 100644 src/main/resources/assets/signalindustries/item/signalum_drill_awakened.png create mode 100644 src/main/resources/assets/signalindustries/item/signalum_drill_reinforced.png rename src/main/resources/assets/signalindustries/misc/{bloodmooncolorizer.png => blood_moon_colorizer.png} (100%) create mode 100644 src/main/resources/assets/signalindustries/mob/infernal.png delete mode 100644 src/main/resources/lang/signalindustries/pl_PL.lang diff --git a/build.gradle b/build.gradle index c1dae141..2bd235c9 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,14 @@ repositories { } metadataSources { artifact() } } + ivy { + url = "https://github.com/Turnip-Labs" + patternLayout { + artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar" + m2compatible = true + } + metadataSources { artifact() } + } ivy { url = "https://github.com/Turnip-Labs" patternLayout { @@ -63,6 +71,14 @@ repositories { } metadataSources { artifact() } } + ivy { + url = "https://github.com/MartinSVK12" + patternLayout { + artifact "[organisation]/releases/download/[revision]bta/[module]-[revision].jar" + m2compatible = true + } + metadataSources { artifact() } + } ivy { url = "https://github.com/ToufouMaster" patternLayout { @@ -71,6 +87,14 @@ repositories { } metadataSources { artifact() } } + ivy { + url = "https://github.com/SamuelDeboni" + patternLayout { + artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar" + m2compatible = true + } + metadataSources { artifact() } + } ivy { url = "https://github.com/MartinSVK12" patternLayout { @@ -93,23 +117,29 @@ dependencies { modImplementation "bta-halplibe:halplibe:${project.halplibe_version}" modImplementation "ModMenu:ModMenu:2.0.0" - modImplementation "fluidapi:fluidapi:1.6.6" - modImplementation "sunsetutils:sunsetutils:1.7.3" - modImplementation "guidebookpp:guidebookpp:1.5.3" - modImplementation "BTWaila:btwaila:pre-r1" + modImplementation "fluidapi:fluidapi:1.6.9" + modImplementation "sunsetutils:sunsetutils:1.8.2" + modImplementation "guidebookpp:guidebookpp:1.5.5" + modImplementation "BTWaila:btwaila:0.2.2" + modImplementation "energyapi:energyapi:1.1.5" + modImplementation "potato-logistics:PotatoLogistics:0.1.4" + + //modImplementation files("C:\\Users\\sunsetsatellite\\Projects\\BTA\\SignalIndustries\\PotatoLogistics-0.1.2.jar") + //modImplementation "retrostorage:retrostorage:1.2.0" implementation "org.slf4j:slf4j-api:1.8.0-beta4" implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0" - implementation("org.apache.commons:commons-lang3:3.12.0") + + //include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9"))) implementation 'com.google.guava:guava:30.0-jre' implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9' + implementation("org.apache.commons:commons-lang3:3.12.0") var log4jVersion = "2.20.0" implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}") implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}") implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}") - implementation("log4j:apache-log4j-extras:1.2.17") } java { diff --git a/gradle.properties b/gradle.properties index 3f01bb6e..7d5d99a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=1.7.7.0_01 +bta_version=1.7.7.0_02 # Loader loader_version=0.14.19-babric.1-bta # HalpLibe -halplibe_version=2.1.1 +halplibe_version=2.2.0 # Mod mod_version=1.0.0 diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 7376375d..601a8191 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -23,16 +23,20 @@ import net.minecraft.core.player.inventory.Container; import net.minecraft.core.player.inventory.IInventory; import net.minecraft.core.world.Dimension; +import net.minecraft.core.world.World; +import net.minecraft.core.world.biome.Biome; +import net.minecraft.core.world.biome.Biomes; import net.minecraft.core.world.type.WorldType; +import net.minecraft.core.world.type.WorldTypes; import net.minecraft.core.world.weather.Weather; import net.minecraft.server.entity.player.EntityPlayerMP; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sunsetsatellite.fluidapi.api.FluidStack; import sunsetsatellite.fluidapi.mixin.accessors.PacketAccessor; -import sunsetsatellite.fluidapi.render.RenderFluidInBlock; import sunsetsatellite.signalindustries.abilities.powersuit.*; import sunsetsatellite.signalindustries.blocks.*; +import sunsetsatellite.signalindustries.dim.WorldTypeEternity; import sunsetsatellite.signalindustries.entities.EntityCrystal; import sunsetsatellite.signalindustries.entities.EntityEnergyOrb; import sunsetsatellite.signalindustries.entities.mob.EntityInfernal; @@ -42,10 +46,14 @@ import sunsetsatellite.signalindustries.items.*; import sunsetsatellite.signalindustries.items.abilities.ItemWithAbility; import sunsetsatellite.signalindustries.items.attachments.ItemAttachment; +import sunsetsatellite.signalindustries.misc.SignalIndustriesAchievementPage; import sunsetsatellite.signalindustries.mp.packets.PacketOpenMachineGUI; +import sunsetsatellite.signalindustries.render.RenderAutoMiner; +import sunsetsatellite.signalindustries.render.RenderFluidInBlock; +import sunsetsatellite.signalindustries.render.RenderFluidInConduit; import sunsetsatellite.signalindustries.util.AttachmentPoint; +import sunsetsatellite.signalindustries.util.BlockTexture; import sunsetsatellite.signalindustries.util.Mode; -import sunsetsatellite.signalindustries.util.RenderFluidInConduit; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.signalindustries.weather.WeatherBloodMoon; import sunsetsatellite.signalindustries.weather.WeatherEclipse; @@ -58,6 +66,7 @@ import sunsetsatellite.sunsetutils.util.multiblocks.StructureCommand; import turniplabs.halplibe.HalpLibe; import turniplabs.halplibe.helper.*; +import turniplabs.halplibe.util.achievements.AchievementPage; import java.util.*; @@ -71,82 +80,138 @@ public class SignalIndustries implements ModInitializer { public static final Config config = new Config(MOD_ID, mapOf(new String[]{"PacketOpenMachineGUI_ID","PacketPipeItemSpawn_ID","GuiID"},new String[]{"113","114","9"}), new Class[]{SignalIndustries.class}); public static HashMap>> nameToGuiMap = new HashMap<>(); - public static final Block signalumOre = BlockHelper.createBlock(MOD_ID,new BlockOreSignalum(key("signalumOre"),config.getFromConfig("signalumOre",availableBlockId++)),"signalumore.png",BlockSounds.STONE,3.0f,25.0f,1); - public static final Block dilithiumOre = BlockHelper.createBlock(MOD_ID,new BlockOreDilithium(key("dilithiumOre"),config.getFromConfig("dilithiumOre",availableBlockId++)),"dilithiumore.png",BlockSounds.STONE,10.0f,25.0f,1); - public static final Block dimensionalShardOre = BlockHelper.createBlock(MOD_ID,new BlockOreDimensionalShard(key("dimensionalShardOre"),config.getFromConfig("dimensionalShardOre",availableBlockId++)),"dimensionalshardore.png",BlockSounds.STONE,100f,50000f,1); + public static final Block signalumOre = BlockHelper.createBlock(MOD_ID,new BlockOreSignalum(key("signalumOre"),config.getFromConfig("signalumOre",availableBlockId++)).withTags(BlockTags.MINEABLE_BY_PICKAXE),"signalum_ore.png",BlockSounds.STONE,3.0f,25.0f,1); + public static final Block dilithiumOre = BlockHelper.createBlock(MOD_ID,new BlockOreDilithium(key("dilithiumOre"),config.getFromConfig("dilithiumOre",availableBlockId++)).withTags(BlockTags.MINEABLE_BY_PICKAXE),"dilithium_ore.png",BlockSounds.STONE,75.0f,100.0f,1); + public static final Block dimensionalShardOre = BlockHelper.createBlock(MOD_ID,new BlockOreDimensionalShard(key("dimensionalShardOre"),config.getFromConfig("dimensionalShardOre",availableBlockId++)).withTags(BlockTags.MINEABLE_BY_PICKAXE),"dimensional_shard_ore.png",BlockSounds.STONE,200f,50000f,1); + + public static final Block dilithiumBlock = new BlockBuilder(MOD_ID) + .setTextures("dilithium_block.png") + .setLuminance(1) + .setBlockSound(BlockSounds.GLASS) + .setHardness(20) + .setResistance(1000) + .build(new Block("dilithiumBlock",config.getFromConfig("dilithiumBlock",availableBlockId++),Material.metal).withTags(BlockTags.MINEABLE_BY_PICKAXE)); + public static final Block emptyCrystalBlock = new BlockBuilder(MOD_ID) + .setTextures("empty_crystal_block.png") + .setLuminance(1) + .setBlockSound(BlockSounds.GLASS) + .setHardness(12) + .setResistance(1000) + .build(new Block("emptyCrystalBlock",config.getFromConfig("emptyCrystalBlock",availableBlockId++),Material.metal).withTags(BlockTags.MINEABLE_BY_PICKAXE)); + public static final Block rawCrystalBlock = new BlockBuilder(MOD_ID) + .setTextures("saturated_crystal_block.png") + .setLuminance(1).setBlockSound(BlockSounds.GLASS) + .setHardness(24).setResistance(50000) + .build(new Block("rawCrystalBlock",config.getFromConfig("rawCrystalBlock",availableBlockId++),Material.metal).withTags(BlockTags.MINEABLE_BY_PICKAXE)); + public static final Block awakenedSignalumCrystalBlock = new BlockBuilder(MOD_ID) + .setTextures("awakened_crystal_block.png") + .setLuminance(1) + .setBlockSound(BlockSounds.GLASS) + .setHardness(50) + .setResistance(1000000) + .build(new Block("awakenedSignalumCrystalBlock",config.getFromConfig("awakenedSignalumCrystalBlock",availableBlockId++),Material.metal).withTags(BlockTags.MINEABLE_BY_PICKAXE)); + + public static final Block dilithiumCrystalBlock = new BlockBuilder(MOD_ID) + .setTextures("dilithium_crystal_block.png") + .setLuminance(1) + .setBlockSound(BlockSounds.GLASS) + .setHardness(20) + .setResistance(1000) + .build(new BlockDilithiumCrystal("dilithiumCrystalBlock",config.getFromConfig("dilithiumCrystalBlock",availableBlockId++),Material.glass,false)).withTags(BlockTags.MINEABLE_BY_PICKAXE); + + public static final Block prototypeMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("prototype.machine"),config.getFromConfig("prototypeMachineCore",availableBlockId++), Tier.PROTOTYPE,Material.stone),"machine_prototype.png",BlockSounds.STONE,2.0f,3.0f,0); + public static final Block basicMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("basic.machine"),config.getFromConfig("basicMachineCore",availableBlockId++), Tier.BASIC,Material.stone),"machine_basic.png",BlockSounds.STONE,3.0f,8.0f,1.0f/2.0f); + public static final Block reinforcedMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("reinforced.machine"),config.getFromConfig("reinforcedMachineCore",availableBlockId++), Tier.REINFORCED,Material.stone),"machine_reinforced.png",BlockSounds.STONE,4.0f,15.0f,1.0f/1.50f); + public static final Block awakenedMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("awakened.machine"),config.getFromConfig("awakenedMachineCore",availableBlockId++), Tier.AWAKENED,Material.stone),"machine_awakened.png",BlockSounds.STONE,5.0f,50.0f,1); + + public static final Block reinforcedCasing = new BlockBuilder(MOD_ID) + .setTextures("reinforced_casing.png") + .setLuminance(0) + .setBlockSound(BlockSounds.METAL) + .setHardness(4) + .setResistance(15) + .build(new Block("reinforced.casing",config.getFromConfig("reinforcedCasing",availableBlockId++),Material.metal).withTags(BlockTags.MINEABLE_BY_PICKAXE)); + public static final Block reinforcedGlass = new BlockBuilder(MOD_ID) + .setTextures("reinforced_glass.png") + .setLuminance(0) + .setBlockSound(BlockSounds.METAL) + .setHardness(4) + .setResistance(15) + .build(new BlockConnectedTexture("reinforced.glass",config.getFromConfig("reinforcedGlass",availableBlockId++),Material.metal,"reinforced_glass").withTags(BlockTags.MINEABLE_BY_PICKAXE)); + + + + public static final Block prototypeConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("prototype.conduit"),config.getFromConfig("prototypeConduit",availableBlockId++), Tier.PROTOTYPE, Material.glass),"conduit_prototype.png",BlockSounds.GLASS,1.0f,1.0f,0); + public static final Block basicConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("basic.conduit"),config.getFromConfig("basicConduit",availableBlockId++), Tier.BASIC,Material.glass),"conduit_basic.png",BlockSounds.GLASS,1.0f,1.0f,0); + public static final Block reinforcedConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("reinforced.conduit"),config.getFromConfig("reinforcedConduit",availableBlockId++), Tier.REINFORCED,Material.glass),"conduit_reinforced.png",BlockSounds.GLASS,1.0f,1.0f,0); + public static final Block awakenedConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("awakened.conduit"),config.getFromConfig("awakenedConduit",availableBlockId++), Tier.AWAKENED,Material.glass),"conduit_awakened.png",BlockSounds.GLASS,1.0f,1.0f,0); + + public static final Block prototypeFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("prototype.conduit.fluid"),config.getFromConfig("prototypeFluidConduit",availableBlockId++), Tier.PROTOTYPE,Material.glass),"fluid_pipe_prototype.png",BlockSounds.GLASS,1.0f,1.0f,0); + public static final Block basicFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("basic.conduit.fluid"),config.getFromConfig("basicFluidConduit",availableBlockId++), Tier.BASIC,Material.glass),"fluid_pipe_basic.png",BlockSounds.GLASS,1.0f,1.0f,0); + public static final Block reinforcedFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("reinforced.conduit.fluid"),config.getFromConfig("reinforcedFluidConduit",availableBlockId++), Tier.REINFORCED,Material.glass),"fluid_pipe_reinforced.png",BlockSounds.GLASS,1.0f,1.0f,0); + + public static final Block infiniteEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("infinite.energyCell"),config.getFromConfig("infiniteEnergyCell",availableBlockId++), Tier.INFINITE,Material.glass),"cell_prototype.png",BlockSounds.GLASS,-1.0f,1000000.0f,0); + public static final Block prototypeEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("prototype.energyCell"),config.getFromConfig("prototypeEnergyCell",availableBlockId++), Tier.PROTOTYPE,Material.glass),"cell_prototype.png",BlockSounds.GLASS,2.0f,5.0f,0); + public static final Block basicEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("basic.energyCell"),config.getFromConfig("basicEnergyCell",availableBlockId++), Tier.BASIC,Material.glass),"cell_basic.png",BlockSounds.GLASS,2.0f,5.0f,0); + + public static final Block prototypeFluidTank = BlockHelper.createBlock(MOD_ID,new BlockSIFluidTank(key("prototype.fluidTank"),config.getFromConfig("prototypeFluidTank",availableBlockId++), Tier.PROTOTYPE,Material.glass),"fluid_tank_prototype.png",BlockSounds.GLASS,2.0f,5.0f,0); + + public static final Block recipeMaker = BlockHelper.createBlock(MOD_ID,new BlockRecipeMaker(key("recipeMaker"),config.getFromConfig("recipeMaker",availableBlockId++),Material.stone),"prototype_connection.png",BlockSounds.STONE,2.0f,5.0f,0); + + + public static final Block prototypeExtractor = BlockHelper.createBlock(MOD_ID,new BlockExtractor(key("prototype.extractor"),config.getFromConfig("prototypeExtractor",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototype_blank.png","extractor_prototype_side_empty.png",BlockSounds.STONE,2,3,0); + public static final Block basicExtractor = BlockHelper.createBlock(MOD_ID,new BlockExtractor(key("basic.extractor"),config.getFromConfig("basicExtractor",availableBlockId++), Tier.BASIC,Material.stone),"basic_blank.png","extractor_basic_side_empty.png",BlockSounds.STONE,2,3,0); + + public static final Block prototypeCrusher = BlockHelper.createBlock(MOD_ID,new BlockCrusher(key("prototype.crusher"),config.getFromConfig("prototypeCrusher",availableBlockId++), Tier.PROTOTYPE,Material.stone),"crusher_prototype_top_inactive.png","prototype_blank.png","crusher_prototype_side.png","prototype_blank.png","prototype_blank.png","prototype_blank.png",BlockSounds.STONE,2,3,0); + public static final Block basicCrusher = BlockHelper.createBlock(MOD_ID,new BlockCrusher(key("basic.crusher"),config.getFromConfig("basicCrusher",availableBlockId++), Tier.BASIC,Material.metal),"crusher_basic_top_inactive.png","basic_blank.png","crusher_basic_side.png","basic_blank.png","basic_blank.png","basic_blank.png",BlockSounds.METAL,2,3,0); + + public static final Block prototypeAlloySmelter = BlockHelper.createBlock(MOD_ID,new BlockAlloySmelter(key("prototype.alloySmelter"),config.getFromConfig("prototypeAlloySmelter",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototype_blank.png","prototype_blank.png","alloy_smelter_prototype_inactive.png","prototype_blank.png","prototype_blank.png","prototype_blank.png",BlockSounds.STONE,2,3,0); + public static final Block basicAlloySmelter = BlockHelper.createBlock(MOD_ID,new BlockAlloySmelter(key("basic.alloySmelter"),config.getFromConfig("basicAlloySmelter",availableBlockId++), Tier.BASIC,Material.metal),"basic_blank.png","basic_blank.png","alloy_smelter_basic_inactive.png","basic_blank.png","basic_blank.png","basic_blank.png",BlockSounds.STONE,2,3,0); + + public static final Block prototypePlateFormer = BlockHelper.createBlock(MOD_ID,new BlockPlateFormer(key("prototype.plateFormer"),config.getFromConfig("prototypePlateFormer",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototype_blank.png","prototype_blank.png","plate_former_prototype_inactive.png","prototype_blank.png","prototype_blank.png","prototype_blank.png",BlockSounds.STONE,2,3,0); + + public static final Block prototypeCrystalCutter = BlockHelper.createBlock(MOD_ID,new BlockCrystalCutter(key("prototype.crystalCutter"),config.getFromConfig("prototypeCrystalCutter",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototype_blank.png","prototype_blank.png","crystal_cutter_prototype_inactive.png","prototype_blank.png","prototype_blank.png","prototype_blank.png",BlockSounds.STONE,2,3,0); + + public static final Block basicCrystalChamber = BlockHelper.createBlock(MOD_ID,new BlockCrystalChamber(key("basic.crystalChamber"),config.getFromConfig("basicCrystalChamber",availableBlockId++), Tier.BASIC,Material.stone),"basic_blank.png","basic_blank.png","basic_crystal_chamber_side_inactive.png","basic_blank.png","basic_blank.png","basic_blank.png",BlockSounds.STONE,2,3,0); + + + public static final Block basicInfuser = BlockHelper.createBlock(MOD_ID,new BlockInfuser(key("basic.infuser"),config.getFromConfig("basic.infuser",availableBlockId++), Tier.BASIC,Material.metal),"basic_blank.png","infuser_basic_side_inactive.png",BlockSounds.METAL,2,3,0); + + public static final Block basicWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(key("basic.wrathBeacon"),config.getFromConfig("basicWrathBeacon",availableBlockId++), Tier.BASIC,Material.metal),"basic_blank.png","wrath_beacon.png",BlockSounds.METAL,10f,500f,1); + //public static final Block reinforcedWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(""),config.getFromConfig("reinforcedWrathBeacon",availableBlockId++),Tiers.REINFORCED,Material.metal),"reinforced.wrathBeacon","reinforced_blank.png","reinforced_wrath_beacon_active.png",BlockSounds.METAL,25f,500f,1); + //public static final Block awakenedWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(""),config.getFromConfig("awakenedWrathBeacon",availableBlockId++),Tiers.AWAKENED,Material.metal),"awakened.wrathBeacon","reinforced_blank.png","awakened_wrath_beacon_active.png",BlockSounds.METAL,25f,500f,1); + public static final int[][] wrathBeaconTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"wrath_beacon.png"),TextureHelper.registerBlockTexture(MOD_ID,"wrath_beacon_active.png")}; + + public static final Block dimensionalAnchor = BlockHelper.createBlock(MOD_ID,new BlockDimensionalAnchor(key("reinforced.dimensionalAnchor"),config.getFromConfig("dimensionalAnchor",availableBlockId++), Tier.REINFORCED,Material.metal),"dimensional_anchor_top_inactive.png","reinforced_blank.png","dimensional_anchor_inactive.png",BlockSounds.METAL,5f,20f,1); + + public static final Block dilithiumStabilizer = BlockHelper.createBlock(MOD_ID,new BlockDilithiumStabilizer(key("reinforced.dilithiumStabilizer"),config.getFromConfig("dilithiumStabilizer",availableBlockId++), Tier.REINFORCED,Material.metal),"reinforced_blank.png","reinforced_blank.png","dilithium_top_inactive.png","dilithium_stabilizer_side_inactive.png","dilithium_stabilizer_side_inactive.png","dilithium_stabilizer_side_inactive.png",BlockSounds.METAL,5f,20f,1); + + public static final Block dilithiumBooster = BlockHelper.createBlock(MOD_ID,new BlockDilithiumBooster(key("reinforced.dilithiumBooster"),config.getFromConfig("dilithiumBooster",availableBlockId++), Tier.REINFORCED,Material.metal),"reinforced_blank.png","reinforced_blank.png","dilithium_top_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png",BlockSounds.METAL,5f,20f,1); + + public static final Block prototypePump = BlockHelper.createBlock(MOD_ID,new BlockPump(key("prototype.pump"),config.getFromConfig("prototypePump",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototype_pump_top_empty.png","prototype_blank.png","prototype_pump_side_empty.png","prototype_pump_side_empty.png","prototype_pump_side_empty.png","prototype_pump_side_empty.png",BlockSounds.STONE,2,3,0); + + + public static final Block prototypeBlockBreaker = BlockHelper.createBlock(MOD_ID, new BlockBreaker(key("prototype.blockBreaker"),config.getFromConfig("prototypeBlockBreaker",availableBlockId++),Tier.PROTOTYPE,Material.stone), "prototype_block_breaker_side_2.png", "prototype_block_breaker_side_2.png", "prototype_block_breaker.png", "prototype_block_breaker_side.png", "prototype_blank.png", "prototype_block_breaker_side.png", BlockSounds.STONE, 2f,3f,0f); + public static final int[][] breakerTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker_active.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker_side.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker_side_active.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker_side_2.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototype_block_breaker_side_2_active.png"),TextureHelper.registerBlockTexture(MOD_ID,"inserteroutput.png")}; + public static final Block basicAutomaticMiner = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.METAL) + .setHardness(2) + .setResistance(3) + .setTextures("basic_blank.png") + .setNorthTexture("basic_automatic_miner.png") + .build(new BlockAutoMiner("basic.automaticMiner",availableBlockId++,Tier.BASIC,Material.metal)); + public static final Block externalIo = new BlockBuilder(MOD_ID) + .setBlockSound(BlockSounds.METAL) + .setHardness(2) + .setResistance(3) + .setTextures("external_io_blank.png") + .build(new BlockExternalIO("basic.externalIO",availableBlockId++,Tier.BASIC,Material.metal)); - public static final Block prototypeMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("prototype.machine"),config.getFromConfig("prototypeMachineCore",availableBlockId++), Tier.PROTOTYPE,Material.stone),"machineprototype.png",BlockSounds.STONE,2.0f,3.0f,0); - public static final Block basicMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("basic.machine"),config.getFromConfig("basicMachineCore",availableBlockId++), Tier.BASIC,Material.stone),"machinebasic.png",BlockSounds.STONE,3.0f,8.0f,1.0f/2.0f); - public static final Block reinforcedMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("reinforced.machine"),config.getFromConfig("reinforcedMachineCore",availableBlockId++), Tier.REINFORCED,Material.stone),"machinereinforced.png",BlockSounds.STONE,4.0f,15.0f,1.0f/1.50f); - public static final Block awakenedMachineCore = BlockHelper.createBlock(MOD_ID,new BlockTiered(key("awakened.machine"),config.getFromConfig("awakenedMachineCore",availableBlockId++), Tier.AWAKENED,Material.stone),"machineawakened.png",BlockSounds.STONE,5.0f,50.0f,1); - - public static final Block prototypeConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("prototype.conduit"),config.getFromConfig("prototypeConduit",availableBlockId++), Tier.PROTOTYPE, Material.glass),"conduitprototype.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block basicConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("basic.conduit"),config.getFromConfig("basicConduit",availableBlockId++), Tier.BASIC,Material.glass),"conduitbasic.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block reinforcedConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("reinforced.conduit"),config.getFromConfig("reinforcedConduit",availableBlockId++), Tier.REINFORCED,Material.glass),"conduitreinforced.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block awakenedConduit = BlockHelper.createBlock(MOD_ID,new BlockConduit(key("awakened.conduit"),config.getFromConfig("awakenedConduit",availableBlockId++), Tier.AWAKENED,Material.glass),"conduitawakened.png",BlockSounds.GLASS,1.0f,1.0f,0); - - public static final Block prototypeFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("prototype.conduit.fluid"),config.getFromConfig("prototypeFluidConduit",availableBlockId++), Tier.PROTOTYPE,Material.glass),"fluidpipeprototype.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block basicFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("basic.conduit.fluid"),config.getFromConfig("basicFluidConduit",availableBlockId++), Tier.BASIC,Material.glass),"fluidpipebasic.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block reinforcedFluidConduit = BlockHelper.createBlock(MOD_ID,new BlockFluidConduit(key("reinforced.conduit.fluid"),config.getFromConfig("reinforcedFluidConduit",availableBlockId++), Tier.REINFORCED,Material.glass),"fluidpipereinforced.png",BlockSounds.GLASS,1.0f,1.0f,0); - - public static final Block infiniteEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("infinite.energyCell"),config.getFromConfig("infiniteEnergyCell",availableBlockId++), Tier.INFINITE,Material.glass),"cellprototype.png",BlockSounds.GLASS,-1.0f,1000000.0f,0); - public static final Block prototypeEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("prototype.energyCell"),config.getFromConfig("prototypeEnergyCell",availableBlockId++), Tier.PROTOTYPE,Material.glass),"cellprototype.png",BlockSounds.GLASS,2.0f,5.0f,0); - public static final Block basicEnergyCell = BlockHelper.createBlock(MOD_ID,new BlockEnergyCell(key("basic.energyCell"),config.getFromConfig("basicEnergyCell",availableBlockId++), Tier.BASIC,Material.glass),"cellbasic.png",BlockSounds.GLASS,2.0f,5.0f,0); - - public static final Block prototypeFluidTank = BlockHelper.createBlock(MOD_ID,new BlockSIFluidTank(key("prototype.fluidTank"),config.getFromConfig("prototypeFluidTank",availableBlockId++), Tier.PROTOTYPE,Material.glass),"fluidtankprototype.png",BlockSounds.GLASS,2.0f,5.0f,0); - - public static final Block recipeMaker = BlockHelper.createBlock(MOD_ID,new BlockRecipeMaker(key("recipeMaker"),config.getFromConfig("recipeMaker",availableBlockId++),Material.stone),"prototypeconnection.png",BlockSounds.STONE,2.0f,5.0f,0); - - - public static final Block prototypeExtractor = BlockHelper.createBlock(MOD_ID,new BlockExtractor(key("prototype.extractor"),config.getFromConfig("prototypeExtractor",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototypeblank.png","extractorprototypesideempty.png",BlockSounds.STONE,2,3,0); - public static final Block basicExtractor = BlockHelper.createBlock(MOD_ID,new BlockExtractor(key("basic.extractor"),config.getFromConfig("basicExtractor",availableBlockId++), Tier.BASIC,Material.stone),"basicblank.png","extractorbasicsideempty.png",BlockSounds.STONE,2,3,0); - public static final int[][] extractorTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"extractorprototypesideempty.png"),TextureHelper.registerBlockTexture(MOD_ID,"extractorprototypesideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"extractorprototypesideactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"extractorbasicsideempty.png"),TextureHelper.registerBlockTexture(MOD_ID,"extractorbasicsideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"extractorbasicsideactive.png")}; - - public static final Block prototypeCrusher = BlockHelper.createBlock(MOD_ID,new BlockCrusher(key("prototype.crusher"),config.getFromConfig("prototypeCrusher",availableBlockId++), Tier.PROTOTYPE,Material.stone),"crusherprototypetopinactive.png","prototypeblank.png","crusherprototypeside.png","prototypeblank.png","prototypeblank.png","prototypeblank.png",BlockSounds.STONE,2,3,0); - public static final Block basicCrusher = BlockHelper.createBlock(MOD_ID,new BlockCrusher(key("basic.crusher"),config.getFromConfig("basicCrusher",availableBlockId++), Tier.BASIC,Material.metal),"crusherbasictopinactive.png","basicblank.png","crusherbasicside.png","basicblank.png","basicblank.png","basicblank.png",BlockSounds.METAL,2,3,0); - public static final int[][] crusherTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"crusherprototypetopinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"crusherprototypetopactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"crusherbasictopinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"crusherbasictopactive.png")}; - - public static final Block prototypeAlloySmelter = BlockHelper.createBlock(MOD_ID,new BlockAlloySmelter(key("prototype.alloySmelter"),config.getFromConfig("prototypeAlloySmelter",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototypeblank.png","prototypeblank.png","alloysmelterprototypeinactive.png","prototypeblank.png","prototypeblank.png","prototypeblank.png",BlockSounds.STONE,2,3,0); - public static final Block basicAlloySmelter = BlockHelper.createBlock(MOD_ID,new BlockAlloySmelter(key("basic.alloySmelter"),config.getFromConfig("basicAlloySmelter",availableBlockId++), Tier.BASIC,Material.metal),"basicblank.png","basicblank.png","alloysmelterbasicinactive.png","basicblank.png","basicblank.png","basicblank.png",BlockSounds.STONE,2,3,0); - public static final int[][] alloySmelterTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"alloysmelterprototypeinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"alloysmelterprototypeactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"alloysmelterbasicinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"alloysmelterbasicactive.png")}; - - public static final Block prototypePlateFormer = BlockHelper.createBlock(MOD_ID,new BlockPlateFormer(key("prototype.plateFormer"),config.getFromConfig("prototypePlateFormer",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototypeblank.png","prototypeblank.png","plateformerprototypeinactive.png","prototypeblank.png","prototypeblank.png","prototypeblank.png",BlockSounds.STONE,2,3,0); - public static final int[][] plateFormerTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"plateformerprototypeinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"plateformerprototypeactive.png")}; - - public static final Block prototypeCrystalCutter = BlockHelper.createBlock(MOD_ID,new BlockCrystalCutter(key("prototype.crystalCutter"),config.getFromConfig("prototypeCrystalCutter",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototypeblank.png","prototypeblank.png","crystalcutterprototypeinactive.png","prototypeblank.png","prototypeblank.png","prototypeblank.png",BlockSounds.STONE,2,3,0); - public static final int[][] crystalCutterTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"crystalcutterprototypeinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"crystalcutterprototypeactive.png")}; - - public static final Block basicCrystalChamber = BlockHelper.createBlock(MOD_ID,new BlockCrystalChamber(key("basic.crystalChamber"),config.getFromConfig("basicCrystalChamber",availableBlockId++), Tier.BASIC,Material.stone),"basicblank.png","basicblank.png","basiccrystalchambersideinactive.png","basicblank.png","basicblank.png","basicblank.png",BlockSounds.STONE,2,3,0); - public static final int[][] crystalChamberTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"basiccrystalchambersideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"basiccrystalchambersideactive.png")}; - - - public static final Block basicInfuser = BlockHelper.createBlock(MOD_ID,new BlockInfuser(key("basic.infuser"),config.getFromConfig("basic.infuser",availableBlockId++), Tier.BASIC,Material.metal),"basicblank.png","infuserbasicsideinactive.png",BlockSounds.METAL,2,3,0); - public static final int[][] infuserTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"infuserbasicsideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"infuserbasicsideactive.png")}; - - public static final Block basicWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(key("basic.wrathBeacon"),config.getFromConfig("basicWrathBeacon",availableBlockId++), Tier.BASIC,Material.metal),"basicblank.png","wrathbeacon.png",BlockSounds.METAL,10f,500f,1); - //public static final Block reinforcedWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(""),config.getFromConfig("reinforcedWrathBeacon",availableBlockId++),Tiers.REINFORCED,Material.metal),"reinforced.wrathBeacon","reinforcedblank.png","reinforcedwrathbeaconactive.png",BlockSounds.METAL,25f,500f,1); - //public static final Block awakenedWrathBeacon = BlockHelper.createBlock(MOD_ID,new BlockWrathBeacon(""),config.getFromConfig("awakenedWrathBeacon",availableBlockId++),Tiers.AWAKENED,Material.metal),"awakened.wrathBeacon","reinforcedblank.png","awakenedwrathbeaconactive.png",BlockSounds.METAL,25f,500f,1); - public static final int[][] wrathBeaconTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"wrathbeacon.png"),TextureHelper.registerBlockTexture(MOD_ID,"wrathbeaconactive.png")}; - - public static final Block dimensionalAnchor = BlockHelper.createBlock(MOD_ID,new BlockDimensionalAnchor(key("reinforced.dimensionalAnchor"),config.getFromConfig("dimensionalAnchor",availableBlockId++), Tier.REINFORCED,Material.metal),"dimensionanchortopinactive.png","reinforcedblank.png","dimensionalanchorinactive.png",BlockSounds.METAL,5f,20f,1); - public static final int[][] anchorTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"dimensionalanchorinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dimensionanchortopinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"reinforcedblank.png"),TextureHelper.registerBlockTexture(MOD_ID,"dimensionalanchor.png"),TextureHelper.registerBlockTexture(MOD_ID,"dimensionanchortop.png"),TextureHelper.registerBlockTexture(MOD_ID,"dimensionalanchorbottom.png")}; - - public static final Block dilithiumStabilizer = BlockHelper.createBlock(MOD_ID,new BlockDilithiumStabilizer(key("reinforced.dilithiumStabilizer"),config.getFromConfig("dilithiumStabilizer",availableBlockId++), Tier.REINFORCED,Material.metal),"reinforcedblank.png","reinforcedblank.png","dilithiumtopinactive.png","dilithiumstabilizersideinactive.png","dilithiumstabilizersideinactive.png","dilithiumstabilizersideinactive.png",BlockSounds.METAL,5f,20f,1); - public static final int[][] dilithStabilizerTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"dilithiumtopinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumtopactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumstabilizersideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumstabilizersideactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"reinforcedblank.png")}; - - public static final Block dilithiumBooster = BlockHelper.createBlock(MOD_ID,new BlockDilithiumBooster(key("reinforced.dilithiumBooster"),config.getFromConfig("dilithiumBooster",availableBlockId++), Tier.REINFORCED,Material.metal),"reinforcedblank.png","reinforcedblank.png","dilithiumtopinactive.png","dilithiumboostersideinactive.png","dilithiumboostersideinactive.png","dilithiumboostersideinactive.png",BlockSounds.METAL,5f,20f,1); - public static final int[][] dilithBoosterTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"dilithiumtopinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumtopactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumboostersideinactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumboostersideactive.png")}; - - public static final Block prototypePump = BlockHelper.createBlock(MOD_ID,new BlockPump(key("prototype.pump"),config.getFromConfig("prototypePump",availableBlockId++), Tier.PROTOTYPE,Material.stone),"prototypepumptop.png","prototypeblank.png","prototypepumpside.png","prototypepumpside.png","prototypepumpside.png","prototypepumpside.png",BlockSounds.STONE,2,3,0); - public static final int[][] pumpTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"prototypepumpsideempty.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypepumpside.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypepumptopempty.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypepumptop.png")}; - - public static final Block prototypeBlockBreaker = BlockHelper.createBlock(MOD_ID, new BlockBreaker(key("prototype.blockBreaker"),config.getFromConfig("prototypeBlockBreaker",availableBlockId++),Tier.PROTOTYPE,Material.stone), "prototypeblockbreakerside2.png", "prototypeblockbreakerside2.png", "prototypeblockbreaker.png", "prototypeblockbreakerside.png", "prototypeblank.png", "prototypeblockbreakerside.png", BlockSounds.STONE, 2f,3f,0f); - public static final int[][] breakerTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreaker.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreakeractive.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreakerside.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreakersideactive.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreakerside2.png"),TextureHelper.registerBlockTexture(MOD_ID,"prototypeblockbreakerside2active.png"),TextureHelper.registerBlockTexture(MOD_ID,"inserteroutput.png")}; //this has to be after any other block - public static final int[] energyTex = TextureHelper.registerBlockTexture(MOD_ID,"signalumenergy.png"); //registerFluidTexture(MOD_ID,"signalumenergy.png",0,4); - public static final Block energyFlowing = BlockHelper.createBlock(MOD_ID,new BlockFluidFlowing(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalumenergy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES); - public static final Block energyStill = BlockHelper.createBlock(MOD_ID,new BlockFluidStill(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalumenergy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES); + public static final int[] energyTex = TextureHelper.registerBlockTexture(MOD_ID,"signalum_energy.png"); //registerFluidTexture(MOD_ID,"signalum_energy.png",0,4); + public static final Block energyFlowing = BlockHelper.createBlock(MOD_ID,new BlockFluidFlowing(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES); + public static final Block energyStill = BlockHelper.createBlock(MOD_ID,new BlockFluidStill(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES); public static final Item signalumCrystalEmpty = ItemHelper.createItem(MOD_ID,new ItemSignalumCrystal(config.getFromConfig("signalumCrystalEmpty",availableItemId++)),"signalumCrystalEmpty","signalumcrystalempty.png").setMaxStackSize(1); @@ -178,27 +243,43 @@ public class SignalIndustries implements ModInitializer { public static final Item diamondCuttingGear = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("diamondCuttingGear",availableItemId++)),"diamondCuttingGear","diamondcuttinggear.png"); - public static final Block portalEternity = BlockHelper.createBlock(MOD_ID,new BlockPortal(key("eternityPortal"),availableBlockId++,3,Block.bedrock.id,Block.fire.id),"realityfabric.png",BlockSounds.GLASS,1.0f,1.0f,1); - public static final Block realityFabric = BlockHelper.createBlock(MOD_ID,new BlockUndroppable(key("realityFabric"),config.getFromConfig("realityFabric",availableBlockId++),Material.dirt),"realityfabric.png",BlockSounds.STONE,150f,50000f,0); - public static final Block rootedFabric = BlockHelper.createBlock(MOD_ID,new Block(key("rootedFabric"),config.getFromConfig("rootedFabric",availableBlockId++),Material.dirt),"rootedfabric.png",BlockSounds.STONE,50f,50000f,0); + public static final Block portalEternity = BlockHelper.createBlock(MOD_ID,new BlockPortal(key("eternityPortal"),availableBlockId++,3,Block.bedrock.id,Block.fire.id),"reality_fabric.png",BlockSounds.GLASS,1.0f,1.0f,1); + public static final Block realityFabric = BlockHelper.createBlock(MOD_ID,new BlockUndroppable(key("realityFabric"),config.getFromConfig("realityFabric",availableBlockId++),Material.dirt),"reality_fabric.png",BlockSounds.STONE,150f,50000f,0); + public static final Block rootedFabric = BlockHelper.createBlock(MOD_ID,new Block(key("rootedFabric"),config.getFromConfig("rootedFabric",availableBlockId++),Material.dirt),"rooted_fabric.png",BlockSounds.STONE,50f,50000f,0); public static final Item monsterShard = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("monsterShard",availableItemId++)),"monsterShard","monstershard.png"); public static final Item infernalFragment = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("infernalFragment",availableItemId++)),"infernalFragment","infernalfragment.png"); public static final Item evilCatalyst = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("evilCatalyst",availableItemId++)),"evilCatalyst","evilcatalyst.png").setMaxStackSize(4); + public static final Item infernalEye = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("infernalEye",availableItemId++)),"infernalEye","infernaleye.png").setMaxStackSize(4); public static final Item dimensionalShard = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("dimensionalShard",availableItemId++)),"dimensionalShard","dimensionalshard.png"); public static final Item warpOrb = ItemHelper.createItem(MOD_ID,new ItemWarpOrb(config.getFromConfig("warpOrb",availableItemId++)),"warpOrb","warporb.png").setMaxStackSize(1); public static final Item realityString = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("realityString",availableItemId++)),"realityString","stringofreality.png"); public static final Item dilithiumShard = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("dilithiumShard",availableItemId++)),"dilithiumShard","dilithiumshard.png"); - public static final Block eternalTreeLog = BlockHelper.createBlock(MOD_ID,new BlockEternalTreeLog(key("eternalTreeLog"),config.getFromConfig("eternalTreeLog",availableBlockId++),Material.wood),"eternaltreelogtop.png","eternaltreelog.png",BlockSounds.WOOD, 75f,50000f,1); + public static final Block eternalTreeLog = new BlockBuilder(MOD_ID) + .setHardness(75f) + .setResistance(50000) + .setLuminance(15) + .setTopBottomTexture("eternal_tree_log_top.png") + .setSides("eternal_tree_log.png") + .setBlockSound(BlockSounds.WOOD) + .build(new BlockEternalTreeLog("eternalTreeLog",config.getFromConfig("eternalTreeLog",availableBlockId++),Material.wood));//BlockHelper.createBlock(MOD_ID,new BlockEternalTreeLog(key("eternalTreeLog"),config.getFromConfig("eternalTreeLog",availableBlockId++),Material.wood),"eternal_tree_log_top.png","eternal_tree_log.png",BlockSounds.WOOD, 75f,50000f,1); - public static final Block glowingObsidian = BlockHelper.createBlock(MOD_ID,new Block(key("glowingObsidian"),config.getFromConfig("glowingObsidian",availableBlockId++),Material.stone),"glowingobsidian.png",BlockSounds.STONE, 50f,1200f,1.0f/2.0f); + public static final Block glowingObsidian = BlockHelper.createBlock(MOD_ID,new Block(key("glowingObsidian"),config.getFromConfig("glowingObsidian",availableBlockId++),Material.stone),"glowing_obsidian.png",BlockSounds.STONE, 50f,1200f,1.0f/2.0f); public static final ArmorMaterial armorPrototypeHarness = ArmorHelper.createArmorMaterial("signalumprototypeharness",1200,10,10,10,10); public static final ArmorMaterial armorSignalumPowerSuit = ArmorHelper.createArmorMaterial("signalumpowersuit",9999,50,50,50,50); - public static final ItemArmorTiered signalumPrototypeHarness = (ItemArmorTiered) ItemHelper.createItem(MOD_ID,new ItemSignalumPrototypeHarness("basic.prototypeHarness",config.getFromConfig("prototypeHarness",700),armorPrototypeHarness,1, Tier.BASIC),"basic.prototypeHarness","harness.png"); - public static final ItemArmorTiered signalumPrototypeHarnessGoggles = (ItemArmorTiered) ItemHelper.createItem(MOD_ID,new ItemSignalumPrototypeHarness("basic.prototypeHarnessGoggles",config.getFromConfig("prototypeHarnessGoggles",701),armorPrototypeHarness,0, Tier.BASIC),"basic.prototypeHarnessGoggles","goggles.png"); + public static final ItemArmorTiered signalumPrototypeHarness = (ItemArmorTiered) ItemHelper.createItem(MOD_ID,new ItemSignalumPrototypeHarness("basic.prototypeHarness",config.getFromConfig("prototypeHarness",availableItemId++),armorPrototypeHarness,1, Tier.BASIC),"basic.prototypeHarness","harness.png"); + public static final ItemArmorTiered signalumPrototypeHarnessGoggles = (ItemArmorTiered) ItemHelper.createItem(MOD_ID,new ItemSignalumPrototypeHarness("basic.prototypeHarnessGoggles",config.getFromConfig("prototypeHarnessGoggles",availableItemId++),armorPrototypeHarness,0, Tier.BASIC),"basic.prototypeHarnessGoggles","goggles.png"); + + public static final ToolMaterial toolMaterialBasic = new ToolMaterial().setDurability(9999).setMiningLevel(3).setEfficiency(25,50); + public static final ToolMaterial toolMaterialReinforced = new ToolMaterial().setDurability(9999).setMiningLevel(4).setEfficiency(45,80); + public static final ToolMaterial toolMaterialAwakened = new ToolMaterial().setDurability(9999).setMiningLevel(5).setEfficiency(60,100); + + public static final Item basicSignalumDrill = ItemHelper.createItem(MOD_ID,new ItemSignalumDrill("basic.signalumDrill",config.getFromConfig("basicSignalumDrill",availableItemId++),Tier.BASIC,toolMaterialBasic),"basic.signalumDrill","signalum_drill.png"); + public static final Item reinforcedSignalumDrill = ItemHelper.createItem(MOD_ID,new ItemSignalumDrill("reinforced.signalumDrill",config.getFromConfig("reinforcedSignalumDrill",availableItemId++),Tier.REINFORCED,toolMaterialReinforced),"reinforced.signalumDrill","signalum_drill_reinforced.png"); + public static final Item nullTrigger = ItemHelper.createItem(MOD_ID,new ItemTrigger(config.getFromConfig("triggerNull",availableItemId++)),"triggerNull","trigger.png").setMaxStackSize(1); @@ -208,10 +289,10 @@ public class SignalIndustries implements ModInitializer { public static final Item energyCatalyst = ItemHelper.createItem(MOD_ID,new Item(config.getFromConfig("energyCatalyst",availableItemId++)),"energyCatalyst","energycatalyst.png"); public static final Item signalumSaber = ItemHelper.createItem(MOD_ID, new ItemSignalumSaber("signalumSaber",config.getFromConfig("signalumSaber",availableItemId++), Tier.REINFORCED, ToolMaterial.stone), "signalumSaber", "signalumsaberunpowered.png"); - public static final int[][] saberTex = new int[][]{TextureHelper.registerItemTexture(MOD_ID,"signalumsaberunpowered.png"),TextureHelper.registerItemTexture(MOD_ID,"signalumsaber.png")}; + public static final int[][] saberTex = new int[][]{TextureHelper.getOrCreateItemTexture(MOD_ID,"signalumsaberunpowered.png"),TextureHelper.getOrCreateItemTexture(MOD_ID,"signalumsaber.png")}; public static final Item pulsar = ItemHelper.createItem(MOD_ID,new ItemPulsar(config.getFromConfig("pulsar",availableItemId++), Tier.REINFORCED),"pulsar","pulsaractive.png").setMaxStackSize(1); - public static final int[][] pulsarTex = new int[][]{TextureHelper.registerItemTexture(MOD_ID,"pulsarinactive.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsaractive.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarcharged.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarwarpactive.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarwarpcharged.png")}; + public static final int[][] pulsarTex = new int[][]{TextureHelper.getOrCreateItemTexture(MOD_ID,"pulsarinactive.png"),TextureHelper.getOrCreateItemTexture(MOD_ID,"pulsaractive.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarcharged.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarwarpactive.png"),TextureHelper.registerItemTexture(MOD_ID,"pulsarwarpcharged.png")}; public static final ItemSignalumPowerSuit signalumPowerSuitHelmet = (ItemSignalumPowerSuit) ItemHelper.createItem(MOD_ID,new ItemSignalumPowerSuit("reinforced.signalumpowersuit.helmet",config.getFromConfig("signalumPowerSuitHelmet",availableItemId++),armorSignalumPowerSuit,0,Tier.REINFORCED),"reinforced.signalumpowersuit.helmet","signalumpowersuit_helmet.png"); public static final ItemSignalumPowerSuit signalumPowerSuitChestplate = (ItemSignalumPowerSuit) ItemHelper.createItem(MOD_ID,new ItemSignalumPowerSuit("reinforced.signalumpowersuit.chestplate",config.getFromConfig("signalumPowerSuitChestplate",availableItemId++),armorSignalumPowerSuit,1,Tier.REINFORCED),"reinforced.signalumpowersuit.chestplate","signalumpowersuit_chestplate.png"); @@ -235,46 +316,106 @@ public class SignalIndustries implements ModInitializer { public static final Item pursuitAbilityModule = ItemHelper.createItem(MOD_ID,new ItemAbilityModule("",config.getFromConfig("pursuitAbilityModule",availableItemId++),Mode.PURSUIT),"pursuitAbilityModule","pursuitmodule.png");*/ public static final Item awakenedAbilityModuel = ItemHelper.createItem(MOD_ID,new ItemAbilityModule(config.getFromConfig("awakenedAbilityModuel",availableItemId++),Mode.AWAKENED),"awakenedAbilityModule","awakenedmodule.png"); - /*public static final Block itemPipe = BlockHelper.createBlock(MOD_ID,new BlockItemPipe("",config.getFromConfig("itemPipe",availableBlockId++),Material.glass),"itemPipe","itempipe.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block itemPipeOpaque = BlockHelper.createBlock(MOD_ID,new BlockItemPipe("",config.getFromConfig("itemPipeOpaque",availableBlockId++),Material.glass),"itemPipeOpaque","itempipeopaque.png",BlockSounds.GLASS,1.0f,1.0f,0); - public static final Block inserter = BlockHelper.createBlock(MOD_ID,new BlockInserter("",config.getFromConfig("inserter",availableBlockId++),Material.stone),"inserter","prototypeblank.png","prototypeblank.png","inserterinput.png","prototypeblank.png","inserteroutput.png","prototypeblank.png",BlockSounds.STONE,1.0f,1.0f,0); - public static final Block filter = BlockHelper.createBlock(MOD_ID,new BlockFilter("",config.getFromConfig("filter",availableBlockId++),Material.stone),"filter","filterred.png","filtergreen.png","filterblue.png","filtercyan.png","filtermagenta.png","filteryellow.png",BlockSounds.STONE,1.0f,1.0f,0);*/ + public static final int[][] railTex = new int[][]{TextureHelper.getOrCreateBlockTexture(MOD_ID,"dilithium_rail_unpowered.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithium_rail.png")}; + public static final Block dilithiumRail = BlockHelper.createBlock(MOD_ID,new BlockDilithiumRail(key("dilithiumRail"),config.getFromConfig("dilithiumRail",availableBlockId++),true),"dilithium_rail_unpowered.png", BlockSounds.METAL,1,50f,0); + + public static final int[] energyOrbTex = TextureHelper.getOrCreateItemTexture(MOD_ID,"energyorb.png"); - public static final int[][] railTex = new int[][]{TextureHelper.registerBlockTexture(MOD_ID,"dilithiumrailunpowered.png"),TextureHelper.registerBlockTexture(MOD_ID,"dilithiumrail.png")}; - public static final Block dilithiumRail = BlockHelper.createBlock(MOD_ID,new BlockDilithiumRail(key("dilithiumRail"),config.getFromConfig("dilithiumRail",availableBlockId++),true),"dilithiumrailunpowered.png", BlockSounds.METAL,1,50f,0); + public static final Weather weatherBloodMoon = new WeatherBloodMoon(10).setLanguageKey("bloodMoon"); + public static final Weather weatherEclipse = new WeatherEclipse(11).setLanguageKey("solarEclipse"); + public static final Weather weatherSolarApocalypse = new WeatherSolarApocalypse(12).setLanguageKey("solarApocalypse"); - public static final int[] energyOrbTex = TextureHelper.registerItemTexture(MOD_ID,"energyorb.png"); + public static final AchievementPage ACHIEVEMENTS = new SignalIndustriesAchievementPage(); - public static Weather weatherBloodMoon = new WeatherBloodMoon(10).setLanguageKey("bloodMoon"); - public static Weather weatherEclipse = new WeatherEclipse(11).setLanguageKey("solarEclipse"); - public static Weather weatherSolarApocalypse = new WeatherSolarApocalypse(12).setLanguageKey("solarApocalypse"); - //public static BiomeGenBase biomeEternity = createBiome(16, BiomeGenEternity.class); - public static Dimension dimEternity; - public static WorldType eternityWorld; + public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome().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); - public static Multiblock dimAnchorMultiblock = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"dimensionalAnchor","dimensionalAnchor",false); + public static final Multiblock dimAnchorMultiblock = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"dimensionalAnchor","dimensionalAnchor",false); + + public static Map textures = new HashMap<>(); @Override public void onInitialize() { LOGGER.info("Signal Industries initialized."); } + static { + try { + Class.forName("net.minecraft.core.block.Block"); + Class.forName("net.minecraft.core.item.Item"); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + + textures.put(Tier.PROTOTYPE.name()+".extractor.active",new BlockTexture(MOD_ID).setTopAndBottom("prototype_blank.png").setSides("extractor_prototype_side_active.png")); + textures.put(Tier.BASIC.name()+".extractor.active",new BlockTexture(MOD_ID).setTopAndBottom("basic_blank.png").setSides("extractor_basic_side_active.png")); + + textures.put(Tier.PROTOTYPE.name()+".crusher.active",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setTopTexture("crusher_prototype_top_active.png").setNorthTexture("crusher_prototype_side.png")); + textures.put(Tier.BASIC.name()+".crusher.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setTopTexture("crusher_basic_top_active.png").setNorthTexture("crusher_basic_side.png")); + + textures.put(Tier.PROTOTYPE.name()+".alloySmelter.active",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setNorthTexture("alloy_smelter_prototype_active.png")); + textures.put(Tier.BASIC.name()+".alloySmelter.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setNorthTexture("alloy_smelter_basic_active.png")); + + textures.put(Tier.PROTOTYPE.name()+".plateFormer.active",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setNorthTexture("plate_former_prototype_active.png")); + + textures.put(Tier.PROTOTYPE.name()+".crystalCutter.active",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setNorthTexture("crystal_cutter_prototype_active.png")); + + textures.put(Tier.BASIC.name()+".crystalChamber.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setNorthTexture("basic_crystal_chamber_side_active.png")); + + textures.put(Tier.BASIC.name()+".infuser.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setSides("infuser_basic_side_active.png")); + + textures.put(Tier.BASIC.name()+".wrathBeacon.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setSides("wrath_beacon_active.png")); + + textures.put(Tier.PROTOTYPE.name()+".pump.active",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setSides("prototype_pump_side.png").setTopTexture("prototype_pump_top.png")); + + textures.put("dimensionalAnchor.active",new BlockTexture(MOD_ID).setSides("dimensional_anchor.png").setBottomTexture("dimensional_anchor_bottom.png").setTopTexture("dimensional_anchor_top.png")); + + textures.put("dilithiumStabilizer.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setSides("dilithium_stabilizer_side_active.png").setNorthTexture("dilithium_top_active.png")); + textures.put("dilithiumBooster.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setSides("dilithium_booster_side_active.png").setNorthTexture("dilithium_top_active.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")); + + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_center.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_bottom.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_bottom_left.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_bottom_right.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_top.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_top_left.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_top_right.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_top_bottom.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_left_right.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_no_right.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_no_left.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_no_bottom.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_no_top.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_left.png"); + TextureHelper.getOrCreateBlockTexture(MOD_ID,"reinforced_glass_right.png"); + + Dimension.registerDimension(config.getFromConfig("eternityDimId",3),dimEternity); + } + + public SignalIndustries(){ + AchievementHelper.addPage(ACHIEVEMENTS); //RecipeFIleLoader.load("/assets/signalindustries/recipes/recipes.txt",mapOf(new String[]{"SignalIndustries"},new String[]{"sunsetsatellite.signalindustries.SignalIndustries"})); BlockModelDispatcher.getInstance().addDispatch(dilithiumRail,new BlockModelRenderBlocks(9)); PacketAccessor.callAddIdClassMapping(config.getFromConfig("PacketOpenMachineGUI_ID",113),true,false, PacketOpenMachineGUI.class); - //PacketAccessor.callAddIdClassMapping(config.getFromConfig("PacketPipeItemSpawn_ID",114),true,false, PacketPipeItemSpawn.class); - //PacketAccessor.callAddIdClassMapping(config.getFromConfig("PacketPipeItemPos_ID",115),true,false, PacketPipeItemPos.class); ItemToolPickaxe.miningLevels.put(signalumOre,3); + ItemToolPickaxe.miningLevels.put(dilithiumBlock,4); + ItemToolPickaxe.miningLevels.put(dilithiumCrystalBlock,4); + ItemToolPickaxe.miningLevels.put(emptyCrystalBlock,3); + ItemToolPickaxe.miningLevels.put(rawCrystalBlock,3); + ItemToolPickaxe.miningLevels.put(awakenedSignalumCrystalBlock,4); ItemToolPickaxe.miningLevels.put(rootedFabric,4); ItemToolPickaxe.miningLevels.put(dimensionalShardOre,4); ItemToolPickaxe.miningLevels.put(dilithiumOre,4); - - - //eternityWorld = createWorldType(14,"eternity").setLanguageKey("worldType.eternity").setDefaultWeather(Weather.weatherClear).setWorldProvider(new WorldProviderEternity()); - //dimEternity = DimensionHelper.createDimension(3,"eternity", Dimension.overworld,1.0f,portalEternity,eternityWorld,0,256); + ItemToolPickaxe.miningLevels.put(realityFabric,5); + ItemToolPickaxe.miningLevels.put(reinforcedGlass,3); + ItemToolPickaxe.miningLevels.put(reinforcedCasing,3); CommandHelper.createCommand(new NBTEditCommand()); CommandHelper.createCommand(new StructureCommand("structure","struct")); @@ -282,7 +423,6 @@ public SignalIndustries(){ EntityHelper.createSpecialTileEntity(TileEntityFluidConduit.class, new RenderFluidInConduit(),"Fluid Conduit"); EntityHelper.createEntity(EntityCrystal.class,new SnowballRenderer(signalumCrystal.getIconFromDamage(0)),47,"signalumCrystal"); EntityHelper.createEntity(EntityEnergyOrb.class,new SnowballRenderer(Block.texCoordToIndex(energyOrbTex[0],energyOrbTex[1])),49,"energyOrb"); - //EntityHelper.createEntity(EntityPipeItem.class,new RenderPipeItem(),48,"pipeItem"); EntityHelper.createSpecialTileEntity(TileEntityEnergyCell.class,new RenderFluidInBlock(),"Energy Cell"); addToNameGuiMap("Energy Cell", GuiEnergyCell.class, TileEntityEnergyCell.class); @@ -323,15 +463,16 @@ public SignalIndustries(){ EntityHelper.createSpecialTileEntity(TileEntityDimensionalAnchor.class,new RenderMultiblock(),"Dimensional Anchor"); addToNameGuiMap("Dimensional Anchor", GuiDimAnchor.class, TileEntityDimensionalAnchor.class); - //EntityHelper.createTileEntity(TileEntityFilter.class,"Filter"); - //addToNameGuiMap("Filter", GuiFilter.class, TileEntityFilter.class); + EntityHelper.createSpecialTileEntity(TileEntityAutoMiner.class, new RenderAutoMiner(),"Automatic Miner"); + addToNameGuiMap("Automatic Miner", GuiAutoMiner.class, TileEntityAutoMiner.class); + + EntityHelper.createTileEntity(TileEntityExternalIO.class,"External I/O"); + addToNameGuiMap("External I/O", GuiExternalIO.class, TileEntityExternalIO.class); addToNameGuiMap("The Pulsar", GuiPulsar.class, InventoryPulsar.class); addToNameGuiMap("Signalum Prototype Harness", GuiHarness.class, InventoryHarness.class); EntityHelper.createTileEntity(TileEntityRecipeMaker.class,"Recipe Maker"); - //EntityHelper.createTileEntity(TileEntityItemPipe.class,"Item Pipe"); - //EntityHelper.createTileEntity(TileEntityInserter.class,"Inserter"); EntityHelper.createTileEntity(TileEntityWrathBeacon.class,"Wrath Beacon"); EntityHelper.createTileEntity(TileEntityBlockBreaker.class,"Block Breaker"); @@ -340,7 +481,6 @@ public SignalIndustries(){ SignalIndustries.LOGGER.info(String.format("Loaded %d internal structures.", Structure.internalStructures.size())); EntityHelper.createEntity(EntityInfernal.class,new MobRenderer(new ModelZombie(), 0.5F),config.getFromConfig("infernalId",50),"Infernal"); - //crafting recipes in RecipeHandlerCraftingSI } @@ -417,74 +557,41 @@ public static void spawnParticle(EntityFX particle){ Minecraft.getMinecraft(Minecraft.class).effectRenderer.addEffect(particle); } - public static WorldType createWorldType(int id, String name){ - /*WorldType[] extendedList = Arrays.copyOf(WorldType.worldTypes, WorldType.worldTypes.length + 1); - WorldTypeAccessor.setWorldTypes(extendedList); - - return new WorldType(id,name);*/ - return null; - - } - - /*public static BiomeGenBase createBiome(int id, Class clazz){ - BiomeGenBase[] extendedList = Arrays.copyOf(BiomeGenBase.biomeList, BiomeGenBase.biomeList.length + 1); - Field biomeListField = ReflectUtils.getField(clazz,"biomeList"); - try { - //lord forgive me for what im about to do - Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); - unsafeField.setAccessible(true); - Unsafe unsafe = (Unsafe) unsafeField.get(null); - Object staticFieldBase = unsafe.staticFieldBase(biomeListField); - long staticFieldOffset = unsafe.staticFieldOffset(biomeListField); - unsafe.putObject(staticFieldBase, staticFieldOffset, extendedList); - return clazz.getConstructor(int.class).newInstance(id); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | - NoSuchFieldException e) { - throw new RuntimeException(e); - } - }*/ - public static Object/*BiomeGenBase*/ createBiome(int id, Class clazz){ - /*BiomeGenBase[] extendedList = Arrays.copyOf(BiomeGenBase.biomeList, BiomeGenBase.biomeList.length + 1); - BiomeGenBaseAccessor.setBiomeList(extendedList); - try { - return clazz.getDeclaredConstructor(int.class).newInstance(id); - } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { - throw new RuntimeException(e); - }*/ - return null; - } - public static String key(String key){ return HalpLibe.addModId(MOD_ID,key); } public static void usePortal(int dim) { - /*Dimension lastDim = Dimension.dimensionList[Minecraft.getMinecraft(Minecraft.class).thePlayer.dimension]; - Dimension newDim = Dimension.dimensionList[dim]; - System.out.println("Switching to dimension \"" + newDim.getName() + "\"!!"); - Minecraft.getMinecraft(Minecraft.class).thePlayer.dimension = dim; - Minecraft.getMinecraft(Minecraft.class).theWorld.setEntityDead(Minecraft.getMinecraft(Minecraft.class).thePlayer); - Minecraft.getMinecraft(Minecraft.class).thePlayer.isDead = false; - double d = Minecraft.getMinecraft(Minecraft.class).thePlayer.posX; - double d1 = Minecraft.getMinecraft(Minecraft.class).thePlayer.posZ; - double newY = Minecraft.getMinecraft(Minecraft.class).thePlayer.posY; + Minecraft mc = Minecraft.getMinecraft(Minecraft.class); + Dimension lastDim = Dimension.getDimensionList().get(mc.thePlayer.dimension); + Dimension newDim = Dimension.getDimensionList().get(dim); + System.out.println("Switching to dimension \"" + newDim.getTranslatedName() + "\"!!"); + mc.thePlayer.dimension = dim; + mc.theWorld.setEntityDead(mc.thePlayer); + mc.thePlayer.removed = false; + double d = mc.thePlayer.x; + double d1 = mc.thePlayer.z; + double newY = mc.thePlayer.y; d *= Dimension.getCoordScale(lastDim, newDim); d1 *= Dimension.getCoordScale(lastDim, newDim); - Minecraft.getMinecraft(Minecraft.class).thePlayer.setLocationAndAngles(d, newY, d1, Minecraft.getMinecraft(Minecraft.class).thePlayer.rotationYaw, Minecraft.getMinecraft(Minecraft.class).thePlayer.rotationPitch); - if (Minecraft.getMinecraft(Minecraft.class).thePlayer.isEntityAlive()) - Minecraft.getMinecraft(Minecraft.class).theWorld.updateEntityWithOptionalForce(Minecraft.getMinecraft(Minecraft.class).thePlayer, false); - World world = null; - world = new World(Minecraft.getMinecraft(Minecraft.class).theWorld, newDim); + mc.thePlayer.moveTo(d, newY, d1, mc.thePlayer.yRot, mc.thePlayer.xRot); + if (mc.thePlayer.isAlive()) { + mc.theWorld.updateEntityWithOptionalForce(mc.thePlayer, false); + } + + World world; + world = new World(mc.theWorld, newDim); if (newDim == lastDim.homeDim) { - Minecraft.getMinecraft(Minecraft.class).changeWorld(world, "Leaving " + lastDim.getName(), Minecraft.getMinecraft(Minecraft.class).thePlayer); + mc.changeWorld(world, "Leaving " + lastDim.getTranslatedName(), mc.thePlayer); } else { - Minecraft.getMinecraft(Minecraft.class).changeWorld(world, "Entering " + newDim.getName(), Minecraft.getMinecraft(Minecraft.class).thePlayer); + mc.changeWorld(world, "Entering " + newDim.getTranslatedName(), mc.thePlayer); + } + + mc.thePlayer.world = mc.theWorld; + if (mc.thePlayer.isAlive()) { + mc.thePlayer.moveTo(d, newY, d1, mc.thePlayer.yRot, mc.thePlayer.xRot); + mc.theWorld.updateEntityWithOptionalForce(mc.thePlayer, false); } - Minecraft.getMinecraft(Minecraft.class).thePlayer.world = Minecraft.getMinecraft(Minecraft.class).theWorld; - if (Minecraft.getMinecraft(Minecraft.class).thePlayer.isEntityAlive()) { - Minecraft.getMinecraft(Minecraft.class).thePlayer.setLocationAndAngles(d, newY, d1, Minecraft.getMinecraft(Minecraft.class).thePlayer.rotationYaw, Minecraft.getMinecraft(Minecraft.class).thePlayer.rotationPitch); - Minecraft.getMinecraft(Minecraft.class).theWorld.updateEntityWithOptionalForce(Minecraft.getMinecraft(Minecraft.class).thePlayer, false); - }*/ } } diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/BTWailaSIPlugin.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/BTWailaSIPlugin.java index ac2f0bc1..9f85100f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/BTWailaSIPlugin.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/BTWailaSIPlugin.java @@ -2,6 +2,7 @@ import org.slf4j.Logger; import sunsetsatellite.signalindustries.api.impl.btwaila.tooltips.EnergyTooltip; +import sunsetsatellite.signalindustries.api.impl.btwaila.tooltips.FluidTooltip; import toufoumaster.btwaila.BTWailaCustomTootltipPlugin; public class BTWailaSIPlugin implements BTWailaCustomTootltipPlugin { @@ -9,5 +10,6 @@ public class BTWailaSIPlugin implements BTWailaCustomTootltipPlugin { public void initializePlugin(Logger logger) { logger.info("Loading tooltips for: BTWailaSIPlugin from signalindustries.."); (new EnergyTooltip()).addTooltip(); + (new FluidTooltip()).addTooltip(); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/EnergyTooltip.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/EnergyTooltip.java index dfaa7d22..b354d84a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/EnergyTooltip.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/EnergyTooltip.java @@ -1,18 +1,20 @@ package sunsetsatellite.signalindustries.api.impl.btwaila.tooltips; +import net.minecraft.core.block.Block; import net.minecraft.core.block.entity.TileEntity; -import sunsetsatellite.fluidapi.FluidAPI; +import net.minecraft.core.lang.I18n; +import net.minecraft.core.util.helper.Side; import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidItemContainer; import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.inventories.*; -import sunsetsatellite.signalindustries.mixin.accessors.GuiBlockOverlayAccessor; -import sunsetsatellite.signalindustries.mixin.invokers.GuiInvoker; -import sunsetsatellite.signalindustries.util.NumberUtil; import toufoumaster.btwaila.BTWaila; import toufoumaster.btwaila.IBTWailaCustomBlockTooltip; import toufoumaster.btwaila.TooltipGroup; import toufoumaster.btwaila.TooltipRegistry; import toufoumaster.btwaila.gui.GuiBlockOverlay; +import toufoumaster.btwaila.util.ColorOptions; +import toufoumaster.btwaila.util.ProgressBarOptions; +import toufoumaster.btwaila.util.TextureOptions; public class EnergyTooltip implements IBTWailaCustomBlockTooltip { @Override @@ -38,30 +40,48 @@ public void addTooltip() { @Override public void drawAdvancedTooltip(TileEntity tileEntity, GuiBlockOverlay guiBlockOverlay) { TileEntityFluidItemContainer tile = (TileEntityFluidItemContainer) tileEntity; - int energySlotId = 0; + int energySlotId = -1; for (int i = 0; i < tile.acceptedFluids.size(); i++) { if(tile.acceptedFluids.get(i).contains(SignalIndustries.energyFlowing)){ energySlotId = i; break; } } - int energy = 0; - int energyMax = tile.fluidCapacity[energySlotId]; - if(tile.fluidContents[energySlotId] != null){ - energy = tile.fluidContents[energySlotId].amount; + if(energySlotId != -1){ + int energy = 0; + int energyMax = tile.fluidCapacity[energySlotId]; + if(tile.fluidContents[energySlotId] != null){ + energy = tile.fluidContents[energySlotId].amount; + } + TextureOptions fgOptions = new TextureOptions().setBlockId(SignalIndustries.energyFlowing.id).setSide(Side.BOTTOM).setMetadata(0); + TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM).setMetadata(0); + ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(true).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText("SE: "); + guiBlockOverlay.drawProgressBarTextureWithText(energy,energyMax,options,0); } - int x = ((GuiBlockOverlayAccessor)guiBlockOverlay).getPosX(); - int y = ((GuiBlockOverlayAccessor)guiBlockOverlay).getOffY(); - - double fill = FluidAPI.map(energy, 0, energyMax, 0, 140); - - ((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x,y+4,x+142,y+20,0xFF000000,0xFF000000); - ((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x+2,y+6, x+140,y+18,0xFF404040,0xFF404040); - ((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x+2,y+6, (int) (x+fill),y+18,0xFFFF0000,0xFFFF0060); - guiBlockOverlay.addOffY(8); - guiBlockOverlay.drawStringWithShadow(String.format("SE: %s/%s (%.1f%%)", NumberUtil.format(energy),NumberUtil.format(energyMax),(((double)energy/(double)energyMax)*100)),-22,0xFFFFFFFF); - guiBlockOverlay.addOffY(-12); - guiBlockOverlay.drawInventory(tile,120); + if(tile instanceof TileEntityTieredMachine) { + ProgressBarOptions options2 = new ProgressBarOptions().setValues(true).setPercentage(true).setBackgroundOptions(new ColorOptions(0x000000)).setForegroundOptions(new ColorOptions(0x00AA00)).setText("Progress: "); + guiBlockOverlay.drawProgressBarWithText(((TileEntityTieredMachine) tile).progressTicks,((TileEntityTieredMachine) tile).progressMaxTicks,options2,0); + } + for (int i = 0; i < tile.fluidContents.length; i++) { + if (tile.fluidContents[i] != null && tile.fluidContents[i].liquid != null && tile.fluidContents[i].liquid != SignalIndustries.energyFlowing) { + String name = I18n.getInstance().translateNameKey(tile.fluidContents[i].liquid.getLanguageKey(0)).replace("Flowing ",""); + TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM); + TextureOptions fgOptions = new TextureOptions().setBlockId(tile.fluidContents[i].liquid.id).setSide(Side.BOTTOM); + if(tile.fluidContents[i].liquid == Block.fluidWaterFlowing){ + fgOptions.setColor(0xA0A0FF); + } + ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(false).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText(name+": "); + guiBlockOverlay.drawProgressBarTextureWithText(tile.fluidContents[i].amount,tile.fluidCapacity[i],options,0); + } + } + guiBlockOverlay.drawInventory(tile,0); + /*guiBlockOverlay.addOffY(12); + for (int i = 0; i < tile.fluidContents.length; i++) { + if(tile.fluidContents[i] != null && tile.fluidContents[i].liquid != null && tile.fluidContents[i].liquid != SignalIndustries.energyFlowing ){ + String name = I18n.getInstance().translateNameKey(tile.fluidContents[i].liquid.getLanguageKey(0)).replace("Flowing ",""); + guiBlockOverlay.drawProgressBarWithText(name+": ",tile.fluidContents[i].amount,tile.fluidCapacity[i],true,false,0); + } + }*/ //guiBlockOverlay.drawStringWithShadow("This is a machine from SignalIndustries!",0,0xFFFF0000); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/FluidTooltip.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/FluidTooltip.java new file mode 100644 index 00000000..2c465068 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/btwaila/tooltips/FluidTooltip.java @@ -0,0 +1,54 @@ +package sunsetsatellite.signalindustries.api.impl.btwaila.tooltips; + +import net.minecraft.client.render.block.color.BlockColorWater; +import net.minecraft.core.block.Block; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.lang.I18n; +import net.minecraft.core.util.helper.Side; +import sunsetsatellite.fluidapi.template.tiles.TileEntityMassFluidItemContainer; +import sunsetsatellite.fluidapi.template.tiles.TileEntityMultiFluidTank; +import sunsetsatellite.signalindustries.SignalIndustries; +import toufoumaster.btwaila.BTWaila; +import toufoumaster.btwaila.IBTWailaCustomBlockTooltip; +import toufoumaster.btwaila.TooltipGroup; +import toufoumaster.btwaila.TooltipRegistry; +import toufoumaster.btwaila.gui.GuiBlockOverlay; +import toufoumaster.btwaila.util.ProgressBarOptions; +import toufoumaster.btwaila.util.TextureOptions; + + +//TODO: Move to fluidapi eventually +public class FluidTooltip implements IBTWailaCustomBlockTooltip { + + @Override + public void addTooltip() { + BTWaila.LOGGER.info("Adding tooltips for: " + this.getClass().getSimpleName()); + TooltipGroup tooltipGroup = new TooltipGroup(SignalIndustries.MOD_ID, TileEntityMassFluidItemContainer.class, this); + tooltipGroup.addTooltip(TileEntityMultiFluidTank.class); + TooltipRegistry.tooltipMap.add(tooltipGroup); + } + + @Override + public void drawAdvancedTooltip(TileEntity tileEntity, GuiBlockOverlay guiBlockOverlay) { + TileEntityMassFluidItemContainer tile = (TileEntityMassFluidItemContainer) tileEntity; + for (int i = 0; i < tile.fluidContents.size(); i++) { + if (tile.fluidContents.get(i) != null && tile.fluidContents.get(i).liquid != null && tile.fluidContents.get(i).liquid != SignalIndustries.energyFlowing) { + String name = I18n.getInstance().translateNameKey(tile.fluidContents.get(i).liquid.getLanguageKey(0)).replace("Flowing ",""); + TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM).setMetadata(0); + TextureOptions fgOptions = new TextureOptions().setBlockId(tile.fluidContents.get(i).liquid.id).setSide(Side.BOTTOM).setMetadata(0); + if(tile.fluidContents.get(i).liquid == Block.fluidWaterFlowing){ + fgOptions.setColor(new BlockColorWater().getWorldColor(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord)); + } + ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(false).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText(name+": "); + guiBlockOverlay.drawProgressBarTextureWithText(tile.fluidContents.get(i).amount,tile.fluidCapacity,options,0); + } + } + /*TileEntityMassFluidItemContainer tile = (TileEntityMassFluidItemContainer) tileEntity; + guiBlockOverlay.addOffY(12); + for (int i = 0; i < tile.fluidContents.size(); i++) { + String name = I18n.getInstance().translateNameKey(tile.fluidContents.get(i).liquid.getLanguageKey(0)); + guiBlockOverlay.drawProgressBarWithText(name+": ",99,tile.fluidCapacity,true,false,0); + }*/ + } + +} diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java index f4ceb9d8..26b154d7 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/fluidapi/SignalIndustriesFluidPlugin.java @@ -9,11 +9,6 @@ import sunsetsatellite.signalindustries.SignalIndustries; public class SignalIndustriesFluidPlugin implements FluidAPIPlugin { - /*@Override - public void initializePlugin(FluidRegistry registry, Logger logger) { - logger.info("Loading fluids from signalindustries.."); - registry.addFluid((BlockFluid) SignalIndustries.energyFlowing,SignalIndustries.signalumCrystal, SignalIndustries.signalumCrystalEmpty); - }*/ @Override public void initializePlugin(Logger logger) { @@ -22,5 +17,9 @@ public void initializePlugin(Logger logger) { FluidRegistry.addToRegistry("signalumEnergy",entry); entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.signalumSaber,SignalIndustries.signalumSaber, (BlockFluid) SignalIndustries.energyFlowing); FluidRegistry.addToRegistry("signalumSaber",entry); + entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.basicSignalumDrill,SignalIndustries.basicSignalumDrill, (BlockFluid) SignalIndustries.energyFlowing); + FluidRegistry.addToRegistry("basicSignalumDrill",entry); + entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.reinforcedSignalumDrill,SignalIndustries.reinforcedSignalumDrill, (BlockFluid) SignalIndustries.energyFlowing); + FluidRegistry.addToRegistry("reinforcedSignalumDrill",entry); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/containers/ContainerGuidebookAlloySmelterRecipe.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/containers/ContainerGuidebookAlloySmelterRecipe.java index e87cb13f..eb3cc334 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/containers/ContainerGuidebookAlloySmelterRecipe.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/containers/ContainerGuidebookAlloySmelterRecipe.java @@ -25,8 +25,8 @@ public class ContainerGuidebookAlloySmelterRecipe extends ContainerGuidebookReci public ContainerGuidebookAlloySmelterRecipe(ItemStack stack, RecipeFluid recipeFluid) { machine = stack; - this.addSlot(new SlotGuidebook(0, 9, 10, recipeFluid.itemInputs.get(0), false)); - this.addSlot(new SlotGuidebook(0, -19, 10, recipeFluid.itemInputs.get(1), false)); + this.addSlot(new SlotGuidebook(0, 9, 10, recipeFluid.itemInputs.get(1), false)); + this.addSlot(new SlotGuidebook(0, -19, 10, recipeFluid.itemInputs.get(0), false)); this.addSlot(new SlotGuidebook(1, 69, 19, recipeFluid.itemOutputs.get(0), false)); this.addSlot(new SlotGuidebook(2, 9, 45, new ItemStack(SignalIndustries.energyFlowing,recipeFluid.cost), false)); this.addSlot(new SlotGuidebook(3,36,18,stack,true)); diff --git a/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/handlers/RecipeHandlerCraftingSI.java b/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/handlers/RecipeHandlerCraftingSI.java index c6341709..125cb8f4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/handlers/RecipeHandlerCraftingSI.java +++ b/src/main/java/sunsetsatellite/signalindustries/api/impl/guidebookpp/handlers/RecipeHandlerCraftingSI.java @@ -30,6 +30,7 @@ public ContainerGuidebookRecipeBase getContainer(Object o) { @Override public void addRecipes() { GuidebookPlusPlus.LOGGER.info("Adding recipes for: " + this.getClass().getSimpleName()); + //TODO: recipes are doplicated in the guidebook fix this later createRecipe(new ItemStack(SignalIndustries.ironPlateHammer, 1),new Object[]{"012","345","678",'1',new ItemStack(Item.ingotIron,1,0),'4',new ItemStack(Item.stick,1,0),'5',new ItemStack(Item.ingotIron,1,0),'6',new ItemStack(Item.stick,1,0)}); createRecipe(new ItemStack(SignalIndustries.diamondCuttingGear, 1),new Object[]{"012","345","678",'1',new ItemStack(Item.diamond,1,0),'3',new ItemStack(Item.diamond,1,0),'5',new ItemStack(Item.diamond,1,0),'7',new ItemStack(Item.diamond,1,0)}); createRecipe(new ItemStack(SignalIndustries.prototypeMachineCore, 1),new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.cobblestonePlate,1,0),'1',new ItemStack(SignalIndustries.stonePlate,1,0),'2',new ItemStack(SignalIndustries.cobblestonePlate,1,0),'3',new ItemStack(SignalIndustries.stonePlate,1,0),'4',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'5',new ItemStack(SignalIndustries.stonePlate,1,0),'6',new ItemStack(SignalIndustries.cobblestonePlate,1,0),'7',new ItemStack(SignalIndustries.stonePlate,1,0),'8',new ItemStack(SignalIndustries.cobblestonePlate,1,0)}); @@ -49,12 +50,14 @@ public void addRecipes() { createRecipe(new ItemStack(SignalIndustries.basicFluidConduit, 4), new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'1',new ItemStack(SignalIndustries.steelPlate,1,0),'2',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'3',new ItemStack(Block.glass,1,0),'4',new ItemStack(SignalIndustries.prototypeFluidConduit,1,0),'5',new ItemStack(Block.glass,1,0),'6',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'7',new ItemStack(SignalIndustries.steelPlate,1,0),'8',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0)}); createRecipe(new ItemStack(SignalIndustries.evilCatalyst, 1),new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.monsterShard,1,0),'1',new ItemStack(SignalIndustries.monsterShard,1,0),'2',new ItemStack(SignalIndustries.monsterShard,1,0),'3',new ItemStack(SignalIndustries.monsterShard,1,0),'4',new ItemStack(Item.slimeball,1,0),'5',new ItemStack(SignalIndustries.monsterShard,1,0),'6',new ItemStack(SignalIndustries.monsterShard,1,0),'7',new ItemStack(SignalIndustries.monsterShard,1,0),'8',new ItemStack(SignalIndustries.monsterShard,1,0)}); createRecipe(new ItemStack(SignalIndustries.basicWrathBeacon, 1), new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'1',new ItemStack(SignalIndustries.monsterShard,1,0),'2',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'3',new ItemStack(Item.bone,1,0),'4',new ItemStack(Block.mobspawner,1,0),'5',new ItemStack(Item.bone,1,0),'6',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0),'7',new ItemStack(SignalIndustries.basicMachineCore,1,0),'8',new ItemStack(SignalIndustries.crystalAlloyPlate,1,0)}); + createRecipe(new ItemStack(SignalIndustries.rawCrystalBlock, 1), new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'1',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'2',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'3',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'4',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'5',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'6',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'7',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0),'8',new ItemStack(SignalIndustries.rawSignalumCrystal,1,0)}); + createRecipe(new ItemStack(SignalIndustries.dilithiumBlock, 1), new Object[]{"012","345","678",'0',new ItemStack(SignalIndustries.dilithiumShard,1,0),'1',new ItemStack(SignalIndustries.dilithiumShard,1,0),'2',new ItemStack(SignalIndustries.dilithiumShard,1,0),'3',new ItemStack(SignalIndustries.dilithiumShard,1,0),'4',new ItemStack(SignalIndustries.dilithiumShard,1,0),'5',new ItemStack(SignalIndustries.dilithiumShard,1,0),'6',new ItemStack(SignalIndustries.dilithiumShard,1,0),'7',new ItemStack(SignalIndustries.dilithiumShard,1,0),'8',new ItemStack(SignalIndustries.dilithiumShard,1,0)}); RecipeRegistry.groups.add(group); } private void createRecipe(ItemStack output, Object[] inputs){ ((CraftingManagerAccessor) RecipeHelper.craftingManager).callAddRecipe(output, inputs); - IRecipe recipe = (IRecipe) RecipeHelper.craftingManager.getRecipeList().get(RecipeHelper.craftingManager.getRecipeList().size()-1); + IRecipe recipe = RecipeHelper.craftingManager.getRecipeList().get(RecipeHelper.craftingManager.getRecipeList().size()-1); RecipeCrafting recipeCrafting = new RecipeCrafting(recipe); group.addRecipe(recipeCrafting); @@ -62,7 +65,7 @@ private void createRecipe(ItemStack output, Object[] inputs){ private void createShapelessRecipe(ItemStack output, Object[] inputs){ ((CraftingManagerAccessor) RecipeHelper.craftingManager).callAddShapelessRecipe(output, inputs); - IRecipe recipe = (IRecipe) RecipeHelper.craftingManager.getRecipeList().get(RecipeHelper.craftingManager.getRecipeList().size()-1); + IRecipe recipe = RecipeHelper.craftingManager.getRecipeList().get(RecipeHelper.craftingManager.getRecipeList().size()-1); RecipeCrafting recipeCrafting = new RecipeCrafting(recipe); group.addRecipe(recipeCrafting); } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAlloySmelter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAlloySmelter.java index c7d0d6ba..1e685a6c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAlloySmelter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAlloySmelter.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerAlloySmelter; import sunsetsatellite.signalindustries.gui.GuiAlloySmelter; import sunsetsatellite.signalindustries.inventories.TileEntityAlloySmelter; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,26 +89,11 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent @Override public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { - TileEntityAlloySmelter tile = (TileEntityAlloySmelter) blockAccess.getBlockTileEntity(x,y,z); + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); int meta = blockAccess.getBlockMetadata(x,y,z); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); //front face - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - int offset = tier.ordinal()+1; - if(tier.ordinal() == 0){ - offset = 0; - } - if(index == 4){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.alloySmelterTex[1+offset][0],SignalIndustries.alloySmelterTex[1+offset][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.alloySmelterTex[offset][0],SignalIndustries.alloySmelterTex[offset][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".alloySmelter.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAutoMiner.java new file mode 100644 index 00000000..e38a5943 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockAutoMiner.java @@ -0,0 +1,86 @@ +package sunsetsatellite.signalindustries.blocks; + +import net.minecraft.core.block.entity.TileEntity; +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.fluidapi.template.tiles.TileEntityFluidPipe; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.containers.ContainerAutoMiner; +import sunsetsatellite.signalindustries.gui.GuiAutoMiner; +import sunsetsatellite.signalindustries.inventories.TileEntityAutoMiner; +import sunsetsatellite.signalindustries.util.Tier; +import sunsetsatellite.sunsetutils.util.Direction; + +import java.util.ArrayList; +import java.util.Random; + +public class BlockAutoMiner extends BlockContainerTiered { + public BlockAutoMiner(String key, int i, Tier tier, Material material) { + super(key, i, tier, material); + } + + @Override + protected TileEntity getNewBlockEntity() { + return new TileEntityAutoMiner(); + } + + @Override + public void onBlockRemoval(World world, int i, int j, int k) { + TileEntityAutoMiner tile = (TileEntityAutoMiner) world.getBlockTileEntity(i, j, k); + if (tile != null) { + for (Direction dir : Direction.values()) { + TileEntity tile2 = dir.getTileEntity(world, tile); + if (tile2 instanceof TileEntityFluidPipe) { + tile.unpressurizePipes((TileEntityFluidPipe) tile2, new ArrayList<>()); + } + } + 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.onBlockRemoval(world, i, j, k); + } + + @Override + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) + { + if(world.isClientSide) + { + return true; + } else + { + TileEntityAutoMiner tile = (TileEntityAutoMiner) world.getBlockTileEntity(i, j, k); + + if(tile != null) { + SignalIndustries.displayGui(entityplayer,new GuiAutoMiner(entityplayer.inventory, tile),new ContainerAutoMiner(entityplayer.inventory,tile),tile,i,j,k); + } + return true; + } + } + +} diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockBreaker.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockBreaker.java index fc70f9e9..32a9e482 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockBreaker.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockBreaker.java @@ -40,7 +40,7 @@ public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side s if(tier.ordinal() == 0){ offset = 0; } - if(index == 4){ + if(index == 2){ if(tile.isActive()){ return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.breakerTex[1+offset][0],SignalIndustries.breakerTex[1+offset][1]); } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockConnectedTexture.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockConnectedTexture.java new file mode 100644 index 00000000..0ecc9b8c --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockConnectedTexture.java @@ -0,0 +1,1239 @@ +package sunsetsatellite.signalindustries.blocks; + +import net.minecraft.core.block.Block; +import net.minecraft.core.block.material.Material; +import net.minecraft.core.util.helper.Axis; +import net.minecraft.core.util.helper.Side; +import net.minecraft.core.util.helper.Sides; +import net.minecraft.core.world.WorldSource; +import sunsetsatellite.signalindustries.SignalIndustries; +import turniplabs.halplibe.helper.TextureHelper; + +public class BlockConnectedTexture extends BlockTransparent { + + public String baseTexture; + public BlockConnectedTexture(String key, int id, Material material, String baseTexture) { + super(key, id, material); + this.baseTexture = baseTexture; + } + + //what you're about to witness is probably the worst code I have ever written, I'm very sorry + //please oh lord, forgive me + @Override + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + int index = Sides.orientationLookUpHorizontal[side.getId()]; + boolean up = blockAccess.getBlock(x,y+1,z) == this; + boolean down = blockAccess.getBlock(x,y-1,z) == this; + boolean north = blockAccess.getBlock(x,y,z-1) == this; + boolean south = blockAccess.getBlock(x,y,z+1) == this; + boolean east = blockAccess.getBlock(x+1,y,z) == this; + boolean west = blockAccess.getBlock(x-1,y,z) == this; + + if(up && down && north && east && south && west){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (up && !down && !north && !east && !south && !west) { + if(side.getAxis() != Axis.Y){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (!up && down && !north && !east && !south && !west) { + if(side.getAxis() != Axis.Y){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && down && !north && !east && !south && !west) { + if(side.getAxis() != Axis.Y){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM || side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (!up && !down && !north && !east && south && !west) { + if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side != Side.NORTH) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } + } else if (!up && !down && north && !east && !south && !west) { + if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side != Side.SOUTH) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } + } else if (!up && !down && north && !east && south && !west) { + if(side == Side.NORTH || side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side != Side.TOP && side != Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && !down && north && !east && !south && !west) { + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && !down && !north && !east && south && !west) { + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (!up && down && north && !east && !south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (!up && down && !north && !east && south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && down && !north && !east && south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && down && north && !east && !south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (!up && down && north && !east && south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && !down && north && !east && south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if (up && down && north && !east && south && !west) { + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && east && !south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+".png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+".png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && east && !south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && east && !south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && east && !south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && east && !south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && east && south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && east && south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && !east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && !east && south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && east && !south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && east && !south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && !east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && !east && !south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && east && south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && east && !south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && !east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_no_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && !north && east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && east && !south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && !east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && !down && north && east && south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && north && !east && !south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && east && south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && north && east && !south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.SOUTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && !east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && !north && east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && !east && south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && east && !south && west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(!up && down && north && east && south && !west){ + if(side == Side.BOTTOM){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.TOP) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && east && south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_left.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && north && !east && south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.NORTH){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_right.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.EAST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && !down && !north && east && south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.EAST){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_top.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_bottom.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && north && !east && south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.EAST){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && north && east && south && !west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.EAST){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && north && east && !south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.EAST){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } else if(up && down && !north && east && south && west){ + if(side == Side.TOP){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if(side == Side.EAST){ + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.BOTTOM) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.NORTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.WEST) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } else if (side == Side.SOUTH) { + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+"_center.png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + } + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+".png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } + + @Override + public int getBlockTextureFromSideAndMetadata(Side side, int meta) { + int index = Sides.orientationLookUpHorizontal[side.getId()]; + int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,this.baseTexture+".png"); + return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrusher.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrusher.java index 49656f64..dc14975e 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrusher.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrusher.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerCrusher; import sunsetsatellite.signalindustries.gui.GuiCrusher; import sunsetsatellite.signalindustries.inventories.TileEntityCrusher; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -89,27 +90,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityCrusher tile = (TileEntityCrusher) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - int offset = tier.ordinal()+1; - if(tier.ordinal() == 0){ - offset = 0; - } - if(index == 1){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crusherTex[1+offset][0],SignalIndustries.crusherTex[1+offset][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crusherTex[offset][0],SignalIndustries.crusherTex[offset][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".crusher.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalChamber.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalChamber.java index 69ed9dd5..c5b3b988 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalChamber.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalChamber.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerCrystalChamber; import sunsetsatellite.signalindustries.gui.GuiCrystalChamber; import sunsetsatellite.signalindustries.inventories.TileEntityCrystalChamber; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,23 +89,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityCrystalChamber tile = (TileEntityCrystalChamber) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 4){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crystalChamberTex[1][0],SignalIndustries.crystalChamberTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crystalChamberTex[0][0],SignalIndustries.crystalChamberTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".crystalChamber.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalCutter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalCutter.java index 9a36c36c..db18aff3 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalCutter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockCrystalCutter.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerCrystalCutter; import sunsetsatellite.signalindustries.gui.GuiCrystalCutter; import sunsetsatellite.signalindustries.inventories.TileEntityCrystalCutter; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,23 +89,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityCrystalCutter tile = (TileEntityCrystalCutter) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 4){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crystalCutterTex[1][0],SignalIndustries.crystalCutterTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.crystalCutterTex[0][0],SignalIndustries.crystalCutterTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".crystalCutter.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumBooster.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumBooster.java index 7fdeecf6..e7a06969 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumBooster.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumBooster.java @@ -88,29 +88,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityBooster tile = (TileEntityBooster) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityBooster tile = (TileEntityBooster) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 4){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithBoosterTex[1][0],SignalIndustries.dilithBoosterTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithBoosterTex[0][0],SignalIndustries.dilithBoosterTex[0][1]); - } - if(index == 2 || index == 3 || index == 5){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithBoosterTex[3][0],SignalIndustries.dilithBoosterTex[3][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithBoosterTex[2][0],SignalIndustries.dilithBoosterTex[2][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get("dilithiumBooster.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumCrystal.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumCrystal.java new file mode 100644 index 00000000..700a96db --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumCrystal.java @@ -0,0 +1,41 @@ +package sunsetsatellite.signalindustries.blocks; + +import net.minecraft.core.block.BlockTransparent; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.block.material.Material; +import net.minecraft.core.enums.EnumDropCause; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.world.World; +import sunsetsatellite.signalindustries.SignalIndustries; + +import java.util.Random; + +public class BlockDilithiumCrystal extends BlockTransparent { + + public BlockDilithiumCrystal(String key, int id, Material material, boolean renderInside) { + super(key, id, material, renderInside); + } + + @Override + public int getRenderBlockPass() { + return 1; + } + + @Override + public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int x, int y, int z, int meta, TileEntity tileEntity) { + switch (dropCause) { + case PICK_BLOCK: + case SILK_TOUCH: { + return new ItemStack[]{new ItemStack(this)}; + } + case PROPER_TOOL: + Random random = new Random(); + if(random.nextFloat() < 0.5f){ + return new ItemStack[]{new ItemStack(SignalIndustries.dilithiumShard,1)}; + } else { + return null; + } + } + return null; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumStabilizer.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumStabilizer.java index 4e799e40..ff120ea8 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumStabilizer.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDilithiumStabilizer.java @@ -88,31 +88,13 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityStabilizer tile = (TileEntityStabilizer) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); //back - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); //front - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityStabilizer tile = (TileEntityStabilizer) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 2){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithStabilizerTex[1][0],SignalIndustries.dilithStabilizerTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithStabilizerTex[0][0],SignalIndustries.dilithStabilizerTex[0][1]); - } else if(index > 1 && index < 6) { - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithStabilizerTex[3][0],SignalIndustries.dilithStabilizerTex[3][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithStabilizerTex[2][0],SignalIndustries.dilithStabilizerTex[2][1]); - } else { - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.dilithStabilizerTex[4][0],SignalIndustries.dilithStabilizerTex[4][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get("dilithiumStabilizer.active").getTexture(Side.getSideById(index)); } - //return this.atlasIndices[index]; + return this.atlasIndices[index]; } } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDimensionalAnchor.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDimensionalAnchor.java index ca56bc5c..2784c3f5 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDimensionalAnchor.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockDimensionalAnchor.java @@ -16,6 +16,7 @@ import sunsetsatellite.signalindustries.gui.GuiDimAnchor; import sunsetsatellite.signalindustries.inventories.TileEntityDimensionalAnchor; import sunsetsatellite.signalindustries.inventories.TileEntityStabilizer; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.BlockInstance; import sunsetsatellite.sunsetutils.util.Direction; @@ -104,7 +105,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } else { TileEntityDimensionalAnchor tile = (TileEntityDimensionalAnchor) world.getBlockTileEntity(i, j, k); - if(tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile),Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){ + if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile),Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){ SignalIndustries.displayGui(entityplayer,new GuiDimAnchor(entityplayer.inventory, tile),new ContainerDimAnchor(entityplayer.inventory,tile),tile,i,j,k); } else { entityplayer.addChatMessage("event.signalindustries.invalidMultiblock"); @@ -114,36 +115,14 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityDimensionalAnchor tile = (TileEntityDimensionalAnchor) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 1){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[4][0],SignalIndustries.anchorTex[4][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[1][0],SignalIndustries.anchorTex[1][1]); - } - if(index == 0){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[5][0],SignalIndustries.anchorTex[5][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[2][0],SignalIndustries.anchorTex[2][1]); - } - if(index > 1 && index < 6){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[3][0],SignalIndustries.anchorTex[3][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.anchorTex[0][0],SignalIndustries.anchorTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get("dimensionalAnchor.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } + } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEternalTreeLog.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEternalTreeLog.java index 6bc85d20..6b713ed8 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEternalTreeLog.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEternalTreeLog.java @@ -3,9 +3,12 @@ import net.minecraft.core.block.BlockRotatable; import net.minecraft.core.block.material.Material; +import net.minecraft.core.world.World; public class BlockEternalTreeLog extends BlockRotatable { public BlockEternalTreeLog(String key, int id, Material material) { super(key, id, material); } + + public void setDefaultDirection(World world, int i, int j, int k) {} } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java new file mode 100644 index 00000000..6f144b8a --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java @@ -0,0 +1,67 @@ +package sunsetsatellite.signalindustries.blocks; + + +import net.minecraft.core.block.Block; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.block.material.Material; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.util.helper.Side; +import net.minecraft.core.util.helper.Sides; +import net.minecraft.core.world.World; +import net.minecraft.core.world.WorldSource; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.containers.ContainerExternalIO; +import sunsetsatellite.signalindustries.gui.GuiExternalIO; +import sunsetsatellite.signalindustries.inventories.TileEntityExternalIO; +import sunsetsatellite.signalindustries.util.Tier; +import sunsetsatellite.sunsetutils.util.Connection; +import sunsetsatellite.sunsetutils.util.Direction; +import turniplabs.halplibe.helper.TextureHelper; + +public class BlockExternalIO extends BlockContainerTiered{ + public BlockExternalIO(String key, int i, Tier tier, Material material) { + super(key, i, tier, material); + } + + @Override + protected TileEntity getNewBlockEntity() { + return new TileEntityExternalIO(); + } + + @Override + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) + { + if(world.isClientSide) + { + return true; + } else + { + TileEntityExternalIO tile = (TileEntityExternalIO) world.getBlockTileEntity(i, j, k); + if(tile != null) { + SignalIndustries.displayGui(entityplayer,new GuiExternalIO(entityplayer.inventory, tile),new ContainerExternalIO(entityplayer.inventory,tile),tile,i,j,k); + } + return true; + } + } + + @Override + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityExternalIO tile = (TileEntityExternalIO) blockAccess.getBlockTileEntity(x,y,z); + 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]); + } 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/BlockExtractor.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExtractor.java index 4a6935f3..d3e719dc 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExtractor.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExtractor.java @@ -23,11 +23,8 @@ public class BlockExtractor extends BlockContainerTiered{ - private static int[][] textures; - public BlockExtractor(String key, int i, Tier tier, Material material) { super(key, i, tier, material); - textures = SignalIndustries.extractorTex; } @Override @@ -94,27 +91,9 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { TileEntityExtractor tile = (TileEntityExtractor) iblockaccess.getBlockTileEntity(i,j,k); int meta = iblockaccess.getBlockMetadata(i,j,k); - textures = SignalIndustries.extractorTex; - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - int offset = (2*tier.ordinal())+1; - if(tier.ordinal() == 0){ - offset = 0; - } - if(index > 1 && index < 6){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(textures[2+offset][0],textures[2+offset][1]); - } else if (tile.getStackInSlot(0) != null) { - return this.atlasIndices[index] = texCoordToIndex(textures[1+offset][0],textures[1+offset][1]); - } - return this.atlasIndices[index] = texCoordToIndex(textures[offset][0],textures[offset][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".extractor.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInfuser.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInfuser.java index d8f879eb..da4b967c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInfuser.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInfuser.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerInfuser; import sunsetsatellite.signalindustries.gui.GuiInfuser; import sunsetsatellite.signalindustries.inventories.TileEntityInfuser; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,23 +89,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityInfuser tile = (TileEntityInfuser) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index > 1 && index < 6){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.infuserTex[1][0],SignalIndustries.infuserTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.infuserTex[0][0],SignalIndustries.infuserTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".infuser.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPlateFormer.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPlateFormer.java index 148b53e7..c6e4e34b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPlateFormer.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPlateFormer.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerPlateFormer; import sunsetsatellite.signalindustries.gui.GuiPlateFormer; import sunsetsatellite.signalindustries.inventories.TileEntityPlateFormer; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,23 +89,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityPlateFormer tile = (TileEntityPlateFormer) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 4){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.plateFormerTex[1][0],SignalIndustries.plateFormerTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.plateFormerTex[0][0],SignalIndustries.plateFormerTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".plateFormer.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPump.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPump.java index 9aa0cbad..be7e1ce9 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPump.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockPump.java @@ -15,6 +15,7 @@ import sunsetsatellite.signalindustries.containers.ContainerPump; import sunsetsatellite.signalindustries.gui.GuiPump; import sunsetsatellite.signalindustries.inventories.TileEntityPump; +import sunsetsatellite.signalindustries.inventories.TileEntityTieredMachine; import sunsetsatellite.signalindustries.util.Tier; import sunsetsatellite.sunsetutils.util.Direction; @@ -88,31 +89,13 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } @Override - public int getBlockTexture(WorldSource iblockaccess, int i, int j, int k, Side side) { - TileEntityPump tile = (TileEntityPump) iblockaccess.getBlockTileEntity(i,j,k); - int meta = iblockaccess.getBlockMetadata(i,j,k); - /* - this.atlasIndices[1] = texCoordToIndex(topX, topY); - this.atlasIndices[0] = texCoordToIndex(bottomX, bottomY); - this.atlasIndices[4] = texCoordToIndex(northX, northY); - this.atlasIndices[2] = texCoordToIndex(eastX, eastY); - this.atlasIndices[5] = texCoordToIndex(southX, southY); - this.atlasIndices[3] = texCoordToIndex(westX, westY); - */ + public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) { + TileEntityTieredMachine tile = (TileEntityTieredMachine) blockAccess.getBlockTileEntity(x,y,z); + int meta = blockAccess.getBlockMetadata(x,y,z); int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()]; - if(index == 1){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.pumpTex[3][0],SignalIndustries.pumpTex[3][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.pumpTex[2][0],SignalIndustries.pumpTex[2][1]); - } - if(index > 1 && index < 6){ - if(tile.isBurning()){ - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.pumpTex[1][0],SignalIndustries.pumpTex[1][1]); - } - return this.atlasIndices[index] = texCoordToIndex(SignalIndustries.pumpTex[0][0],SignalIndustries.pumpTex[0][1]); + if(tile.isBurning()){ + return SignalIndustries.textures.get(tile.tier.name()+".pump.active").getTexture(Side.getSideById(index)); } return this.atlasIndices[index]; } - } diff --git a/src/main/java/sunsetsatellite/signalindustries/containers/ContainerAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerAutoMiner.java new file mode 100644 index 00000000..b3c7e413 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerAutoMiner.java @@ -0,0 +1,40 @@ +package sunsetsatellite.signalindustries.containers; + + +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.player.inventory.IInventory; +import net.minecraft.core.player.inventory.slot.Slot; +import sunsetsatellite.fluidapi.api.ContainerFluid; +import sunsetsatellite.fluidapi.api.SlotFluid; +import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidItemContainer; + +public class ContainerAutoMiner extends ContainerFluid { + + public ContainerAutoMiner(IInventory iInventory, TileEntityFluidItemContainer tileEntity){ + super(iInventory, tileEntity); + tile = tileEntity; + + SlotFluid slot = new SlotFluid(tileEntity, 0, 9,53); //116 35 + addFluidSlot(slot); + this.addSlot(new Slot(tileEntity,0,130 + 4,31 + 4)); + + for(int j = 0; j < 3; j++) + { + for(int i1 = 0; i1 < 9; i1++) + { + addSlot(new Slot(iInventory, i1 + j * 9 + 9, 8 + i1 * 18, 84 + j * 18)); + } + + } + + for(int k = 0; k < 9; k++) + { + addSlot(new Slot(iInventory, k, 8 + k * 18, 142)); + } + } + + @Override + public boolean isUsableByPlayer(EntityPlayer entityPlayer1) { + return true; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/containers/ContainerExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerExternalIO.java new file mode 100644 index 00000000..cfc38159 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/containers/ContainerExternalIO.java @@ -0,0 +1,49 @@ +package sunsetsatellite.signalindustries.containers; + + +import net.minecraft.core.InventoryAction; +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.player.inventory.slot.Slot; +import sunsetsatellite.signalindustries.inventories.TileEntityExternalIO; + +import java.util.List; + +public class ContainerExternalIO extends Container { + + protected TileEntityExternalIO tile; + + public ContainerExternalIO(IInventory iInventory, TileEntityExternalIO tileEntity){ + tile = tileEntity; + + for(int j = 0; j < 3; j++) + { + for(int i1 = 0; i1 < 9; i1++) + { + addSlot(new Slot(iInventory, i1 + j * 9 + 9, 8 + i1 * 18, 84 + j * 18)); + } + + } + + for(int k = 0; k < 9; k++) + { + addSlot(new Slot(iInventory, k, 8 + k * 18, 142)); + } + } + + @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 entityPlayer1) { + return true; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/dim/ChunkDecoratorEternity.java b/src/main/java/sunsetsatellite/signalindustries/dim/ChunkDecoratorEternity.java new file mode 100644 index 00000000..71776a39 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/dim/ChunkDecoratorEternity.java @@ -0,0 +1,41 @@ +package sunsetsatellite.signalindustries.dim; + +import net.minecraft.core.world.World; +import net.minecraft.core.world.chunk.Chunk; +import net.minecraft.core.world.generate.chunk.ChunkDecorator; +import net.minecraft.core.world.generate.feature.WorldFeature; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.worldgen.WorldFeatureDilithiumCrystal; +import sunsetsatellite.signalindustries.worldgen.WorldFeatureEternalTree; +import sunsetsatellite.signalindustries.worldgen.WorldFeatureObelisk; + +import java.util.Random; + +public class ChunkDecoratorEternity implements ChunkDecorator { + + public World world; + + public ChunkDecoratorEternity(World world) { + this.world = world; + } + + @Override + public void decorate(Chunk chunk) { + Random random = new Random(); + int x = chunk.xPosition * 16; + int z = chunk.zPosition * 16; + int y = this.world.getHeightValue(x, z); + if(random.nextInt(32) == 0){ + WorldFeature tree = new WorldFeatureEternalTree(0, SignalIndustries.eternalTreeLog.id); + tree.generate(world,random,x,y,z); + } + if(random.nextInt(128) == 0){ + WorldFeature obelisk = new WorldFeatureObelisk(); + obelisk.generate(world,random,x,y,z); + } + if(random.nextInt(64) == 0){ + WorldFeature crystal = new WorldFeatureDilithiumCrystal(); + crystal.generate(world,random,x,y,z); + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/dim/ChunkGeneratorEternity.java b/src/main/java/sunsetsatellite/signalindustries/dim/ChunkGeneratorEternity.java new file mode 100644 index 00000000..9ab2130d --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/dim/ChunkGeneratorEternity.java @@ -0,0 +1,12 @@ +package sunsetsatellite.signalindustries.dim; + +import net.minecraft.core.world.World; +import net.minecraft.core.world.generate.MapGenBase; +import net.minecraft.core.world.generate.chunk.perlin.ChunkGeneratorPerlin; +import net.minecraft.core.world.generate.chunk.perlin.overworld.TerrainGeneratorOverworld; + +public class ChunkGeneratorEternity extends ChunkGeneratorPerlin { + protected ChunkGeneratorEternity(World world) { + super(world, new ChunkDecoratorEternity(world), new TerrainGeneratorOverworld(world), new SurfaceGeneratorEternity(), new MapGenBase()); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/dim/SurfaceGeneratorEternity.java b/src/main/java/sunsetsatellite/signalindustries/dim/SurfaceGeneratorEternity.java new file mode 100644 index 00000000..761856a2 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/dim/SurfaceGeneratorEternity.java @@ -0,0 +1,11 @@ +package sunsetsatellite.signalindustries.dim; + +import net.minecraft.core.world.chunk.Chunk; +import net.minecraft.core.world.generate.chunk.perlin.SurfaceGenerator; + +public class SurfaceGeneratorEternity implements SurfaceGenerator { + @Override + public void generateSurface(Chunk chunk, short[] ss) { + + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/dim/WorldTypeEternity.java b/src/main/java/sunsetsatellite/signalindustries/dim/WorldTypeEternity.java new file mode 100644 index 00000000..a07bd94c --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/dim/WorldTypeEternity.java @@ -0,0 +1,111 @@ +package sunsetsatellite.signalindustries.dim; + +import net.minecraft.core.util.phys.Vec3d; +import net.minecraft.core.world.World; +import net.minecraft.core.world.biome.provider.BiomeProvider; +import net.minecraft.core.world.biome.provider.BiomeProviderSingleBiome; +import net.minecraft.core.world.config.season.SeasonConfig; +import net.minecraft.core.world.generate.chunk.ChunkGenerator; +import net.minecraft.core.world.season.Seasons; +import net.minecraft.core.world.type.WorldType; +import net.minecraft.core.world.weather.Weather; +import net.minecraft.core.world.wind.WindManagerGeneric; +import sunsetsatellite.signalindustries.SignalIndustries; + +public class WorldTypeEternity extends WorldType { + public WorldTypeEternity(String languageKey) { + super(languageKey, Weather.overworldClear, new WindManagerGeneric(), false, getLightRamp(), SeasonConfig.builder().withSingleSeason(Seasons.NULL).build()); + } + + private static float[] getLightRamp() { + float[] brightnessRamp = new float[32]; + float f = 0.1F; + + for(int i = 0; i <= 15; ++i) { + float f1 = 1.0F - (float)i / 15.0F; + brightnessRamp[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + + return brightnessRamp; + } + + @Override + public int getMinY() { + return 0; + } + + @Override + public int getMaxY() { + return 255; + } + + @Override + public int getOceanY() { + return 32; + } + + @Override + public int getOceanBlock() { + return 0; + } + + @Override + public int getFillerBlock() { + return SignalIndustries.realityFabric.id; + } + + @Override + public BiomeProvider createBiomeProvider(World world) { + return new BiomeProviderSingleBiome(SignalIndustries.biomeEternity, 1.0, 1.0, 1.0); + } + + @Override + public ChunkGenerator createChunkGenerator(World world) { + return new ChunkGeneratorEternity(world); + } + + @Override + public boolean isValidSpawn(World world, int i, int j, int k) { + return true; + } + + @Override + public int getDayNightCycleLengthTicks() { + return 0; + } + + @Override + public float getCelestialAngle(World world, long l, float f) { + return 0.5f; + } + + @Override + public float[] getSunriseColor(float f, float g) { + return new float[4]; + } + + @Override + public int getSkyDarken(World world, long l, float f) { + return 0; + } + + @Override + public Vec3d getFogColor(float f, float g) { + return Vec3d.createVector(0.0, 0.0, 0.0); + } + + @Override + public boolean mayRespawn() { + return false; + } + + @Override + public float getCloudHeight() { + return 0; + } + + @Override + public boolean hasGround() { + return false; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java b/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java index e3801d74..5bb94850 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/EntityCrystal.java @@ -5,8 +5,6 @@ import net.minecraft.core.entity.Entity; import net.minecraft.core.entity.EntityLiving; import net.minecraft.core.entity.player.EntityPlayer; -import net.minecraft.core.item.Item; -import net.minecraft.core.item.ItemStack; import net.minecraft.core.util.helper.DamageType; import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.util.phys.Vec3d; @@ -177,23 +175,22 @@ public void tick() { vec3d1 = Vec3d.createVector(movingobjectposition.location.xCoord, movingobjectposition.location.yCoord, movingobjectposition.location.zCoord); } - if (!this.world.isClientSide) { - List list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.bb.addCoord(this.xd, this.yd, this.zd).expand(3.0, 3.0, 3.0)); - for (Entity entity : list) { - if(entity instanceof EntityLiving){ - if(thrower == entity){ - ((EntityLiving) entity).heal(this.damage); - } else { - entity.hurt(this.thrower,this.damage, DamageType.COMBAT); + if (movingobjectposition != null) { + + if (!this.world.isClientSide) { + List list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.bb.addCoord(this.xd, this.yd, this.zd).expand(3.0, 3.0, 3.0)); + + for (Entity entity : list) { + if(entity instanceof EntityLiving){ + if(thrower == entity){ + ((EntityLiving) entity).heal(this.damage); + } else { + entity.hurt(this.thrower,this.damage, DamageType.COMBAT); + } } } } - } - - world.playSoundAtEntity(this, "signalindustries.crystalbreak", 0.5F, 1F / (this.random.nextFloat() * 0.4F + 0.8F)); - - if (movingobjectposition != null) { for(int j = 0; j < 8; ++j) { this.world.spawnParticle("dustcloud", this.x, this.y, this.z, 0.0, 0.0, 0.0); @@ -202,6 +199,8 @@ public void tick() { } } + world.playSoundAtEntity(this, "signalindustries.crystalbreak", 0.5F, 1F / (this.random.nextFloat() * 0.4F + 0.8F)); + this.remove(); } @@ -270,8 +269,7 @@ public void readAdditionalSaveData(CompoundTag tag) { @Override public void playerTouch(EntityPlayer player) { - if (this.inGroundSnowball && this.thrower == player && this.shakeSnowball <= 0 && player.inventory.addItemStackToInventory(new ItemStack(Item.ammoArrow, 1)) - ) + 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); player.onItemPickup(this, 1); diff --git a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java index cef33279..c0a99fbe 100644 --- a/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java +++ b/src/main/java/sunsetsatellite/signalindustries/entities/ExplosionEnergy.java @@ -86,7 +86,10 @@ public void doExplosionB(boolean particles, float red, float green, float blue) } public void doExplosionB(boolean particles) { - this.world.playSoundAtEntity(exploder, "rand.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F); + 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); + + } List arraylist = new ArrayList<>(this.destroyedBlockPositions); for (int i = arraylist.size() - 1; i >= 0; i--) { ChunkPosition chunkposition = arraylist.get(i); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java new file mode 100644 index 00000000..bdd706b1 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java @@ -0,0 +1,143 @@ +package sunsetsatellite.signalindustries.gui; + + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.lang.I18n; +import net.minecraft.core.player.inventory.InventoryPlayer; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.fluidapi.api.GuiFluid; +import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidItemContainer; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; +import sunsetsatellite.signalindustries.containers.ContainerAutoMiner; +import sunsetsatellite.signalindustries.inventories.TileEntityAutoMiner; + +public class GuiAutoMiner extends GuiFluid { + + public String name = "Automatic Miner"; + public EntityPlayer entityplayer; + public TileEntityAutoMiner tile; + + + public GuiAutoMiner(InventoryPlayer inventoryPlayer, TileEntity tile) { + super(new ContainerAutoMiner(inventoryPlayer, (TileEntityFluidItemContainer) tile),inventoryPlayer); + this.tile = (TileEntityAutoMiner) 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+43 && y < j+49){ + 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 + 43 && y < j + 49) { + 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/autominer.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); + int i5; + if(this.tile.isBurning()) { + i5 = 12; //this.tile.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(i3 + 9, i4 + 36 + 12 - i5, 176, 12 - i5, 14, i5 + 2); + } + + /*i5 = this.tile.getProgressScaled(24); + this.drawTexturedModalRect(i3 + 79, i4 + 35, 176, 14, i5 + 1, 18);*/ + } + + protected void drawGuiContainerForegroundLayer() + { + super.drawGuiContainerForegroundLayer(); + int color = 0xFFFFFFFF; + switch (((BlockContainerTiered)tile.getBlockType()).tier){ + case PROTOTYPE: + break; + case BASIC: + color = 0xFFFF8080; + break; + case REINFORCED: + color = 0xFFFF0000; + break; + case AWAKENED: + color = 0xFFFFA500; + break; + } + fontRenderer.drawCenteredString(name, 90, 4, color); + fontRenderer.drawStringWithShadow("X: "+(tile.current.x-tile.xCoord),38,20,0xFFFF0000); + fontRenderer.drawStringWithShadow("Y: "+(tile.current.y-tile.yCoord),38,32,0xFF4080FF); + fontRenderer.drawStringWithShadow("Z: "+(tile.current.z-tile.zCoord),38,44,0xFF00FF00); + fontRenderer.drawStringWithShadow("S: "+(tile.progressMaxTicks/tile.speedMultiplier)+"t",80,44,0xFFFF8000); + fontRenderer.drawStringWithShadow("C: "+(tile.cost),80,32,0xFF800000); + //fontRenderer.drawString(String.format("X: %d Y: %d Z: %d",tile.current.x,tile.current.y,tile.current.z),38,20,0xFFFFFFFF); + } + + protected void buttonPressed(GuiButton guibutton) { + if (!guibutton.enabled) { + return; + } + switch (guibutton.id){ + case 0: + SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord); + break; + case 1: + SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord); + break; + case 2: + if(tile.workTimer.isPaused()){ + tile.workTimer.unpause(); + } else { + tile.workTimer.pause(); + } + guibutton.displayString = tile.workTimer.isPaused() ? "OFF" : "ON"; + default: + break; + } + } + + public void initGui() + { + controlList.add(new GuiButton(0, Math.round(width / 2) + 60, Math.round(height / 2) - 80, 20, 20, "F")); + controlList.add(new GuiButton(1, Math.round(width / 2) + 60, Math.round(height / 2) - 24, 20, 20, "I")); + controlList.add(new GuiButton(2, Math.round(width / 2) - 81, Math.round(height / 2) - 80, 20, 20, tile.workTimer.isPaused() ? "OFF" : "ON")); + super.initGui(); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java new file mode 100644 index 00000000..16d5993b --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java @@ -0,0 +1,141 @@ +package sunsetsatellite.signalindustries.gui; + + +import net.minecraft.client.entity.player.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiContainer; +import net.minecraft.client.gui.GuiTooltip; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.lang.I18n; +import net.minecraft.core.player.inventory.IInventory; +import net.minecraft.core.player.inventory.InventoryPlayer; +import net.minecraft.server.entity.player.EntityPlayerMP; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.fluidapi.api.IFluidInventory; +import sunsetsatellite.guidebookpp.GuidebookPlusPlus; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; +import sunsetsatellite.signalindustries.containers.ContainerExternalIO; +import sunsetsatellite.signalindustries.inventories.TileEntityExternalIO; + +public class GuiExternalIO extends GuiContainer { + + public String name = "External I/O"; + public EntityPlayer entityplayer; + public TileEntityExternalIO tile; + + + public GuiExternalIO(InventoryPlayer inventoryPlayer, TileEntity tile) { + super(new ContainerExternalIO(inventoryPlayer, (TileEntityExternalIO) tile)); + this.tile = (TileEntityExternalIO) 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"); + 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); + } + + protected void drawGuiContainerForegroundLayer() + { + super.drawGuiContainerForegroundLayer(); + int color = 0xFFFFFFFF; + switch (((BlockContainerTiered)tile.getBlockType()).tier){ + case PROTOTYPE: + break; + case BASIC: + color = 0xFFFF8080; + break; + case REINFORCED: + color = 0xFFFF0000; + break; + case AWAKENED: + color = 0xFFFFA500; + break; + } + 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); + } else { + fontRenderer.drawCenteredString("Disconnected.",x,y,0xFFFF0000); + } + } + protected void buttonPressed(GuiButton guibutton) { + if (!guibutton.enabled) { + return; + } + switch (guibutton.id){ + case 0: + SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord); + break; + case 1: + SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.xCoord,tile.yCoord,tile.zCoord); + break; + default: + break; + } + } + + public void initGui() + { + 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"); + if(!(tile.externalTile instanceof IInventory)){ + itemIo.enabled = false; + } + if(!(tile.externalTile instanceof IFluidInventory)){ + fluidIo.enabled = false; + } + controlList.add(fluidIo); + controlList.add(itemIo); + super.initGui(); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java index cb600010..d3717441 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java @@ -82,14 +82,14 @@ public void drawScreen(int x, int y, float renderPartialTicks) { this.drawGuiContainerBackgroundLayer(renderPartialTicks); GL11.glPushMatrix(); GL11.glRotatef(120.0F, 1.0F, 0.0F, 0.0F); - Lighting.turnOn(); + 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.turnOff(); + Lighting.disable(); GL11.glDisable(2896); GL11.glDisable(2929); this.drawGuiContainerForegroundLayer(); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java index 43a27b3b..3290a293 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java @@ -81,14 +81,14 @@ public void drawScreen(int x, int y, float renderPartialTicks) { this.drawGuiContainerBackgroundLayer(renderPartialTicks); GL11.glPushMatrix(); GL11.glRotatef(120.0F, 1.0F, 0.0F, 0.0F); - Lighting.turnOn(); + 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.turnOff(); + Lighting.disable(); GL11.glDisable(2896); GL11.glDisable(2929); this.drawGuiContainerForegroundLayer(); diff --git a/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IKeybinds.java b/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IKeybinds.java index e204c740..a8dc2e62 100644 --- a/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IKeybinds.java +++ b/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IKeybinds.java @@ -7,4 +7,6 @@ public interface IKeybinds { KeyBinding signalIndustries$getKeyOpenSuit(); KeyBinding signalIndustries$getKeyActivateAbility(); + + KeyBinding signalIndustries$getKeySwitchMode(); } diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/InventoryPulsar.java b/src/main/java/sunsetsatellite/signalindustries/inventories/InventoryPulsar.java index 74fc441f..e52f2962 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/InventoryPulsar.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/InventoryPulsar.java @@ -15,7 +15,7 @@ public InventoryPulsar(ItemStack pulsar) { /*public void setInventorySlotContents(int i, ItemStack itemstack) { if(itemstack != null && itemstack.itemID == SignalIndustries.warpOrb.itemID){ - if(!itemstack.tag.hasKey("position")){ + if(!itemstack.getData().hasKey("position")){ Minecraft.getMinecraft(Minecraft.class).ingameGUI.addChatMessage(TextFormatting.WHITE+"The Pulsar> "+TextFormatting.orange+"WARNING:"+TextFormatting.WHITE+" This "+TextFormatting.magenta+"Warp Orb"+TextFormatting.WHITE+" isn't encoded! There is no telling where this might lead you to. You might die or not be able to get back if you're unprepared. Proceed with caution."); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAlloySmelter.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAlloySmelter.java index 3121f4f8..a87192a3 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAlloySmelter.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAlloySmelter.java @@ -32,6 +32,7 @@ public void updateEntity() { extractFluids(); BlockContainerTiered block = (BlockContainerTiered) getBlockType(); if(block != null) { + tier = block.tier; switch (block.tier) { case PROTOTYPE: recipes = AlloySmelterRecipes.instance; diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAutoMiner.java new file mode 100644 index 00000000..e6205b82 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityAutoMiner.java @@ -0,0 +1,143 @@ +package sunsetsatellite.signalindustries.inventories; + +import net.minecraft.core.block.Block; +import net.minecraft.core.block.BlockFluid; +import net.minecraft.core.block.entity.TileEntity; +import net.minecraft.core.block.entity.TileEntityChest; +import net.minecraft.core.enums.EnumDropCause; +import net.minecraft.core.item.ItemStack; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.interfaces.IBoostable; +import sunsetsatellite.sunsetutils.util.Connection; +import sunsetsatellite.sunsetutils.util.Direction; +import sunsetsatellite.sunsetutils.util.TickTimer; +import sunsetsatellite.sunsetutils.util.Vec3i; + +public class TileEntityAutoMiner extends TileEntityTieredMachine implements IBoostable { + + public Vec3i from = new Vec3i(); + public Vec3i to = new Vec3i(); + public Vec3i current = new Vec3i(); + public TickTimer workTimer = new TickTimer(this,"work",progressMaxTicks,true); + public TileEntityAutoMiner(){ + progressMaxTicks = 20; + cost = 250; + itemContents = new ItemStack[1]; + fluidCapacity[0] = Short.MAX_VALUE*2; + acceptedFluids.get(0).add((BlockFluid) SignalIndustries.energyFlowing); + from = new Vec3i(0,4,0); + to = new Vec3i(-16,-yCoord-4,16); + workTimer.pause(); + transferSpeed = 50; + //.copy().add(new Vec3i(1,0,1)); + } + + public void work(){ + if(fluidContents[0] != null && fluidContents[0].amount > cost){ + fluidContents[0].amount -= cost; + if(fluidContents[0].amount <= 0){ + fluidContents[0] = null; + } + + current.x--; + current.y = worldObj.findTopSolidBlock(current.x, current.z); + System.out.println(current.y); + if(current.y < 1){ + current.y = yCoord+4; + //workTimer.pause(); + } + if(current.x < xCoord-16){ + current.x = xCoord-1; + current.z++; + current.y = worldObj.findTopSolidBlock(current.x, current.z); + if(current.z > zCoord+16){ + current.z = zCoord+1; + current.y = worldObj.findTopSolidBlock(current.x, current.z); + } + } + + //SignalIndustries.LOGGER.info(String.valueOf(current.y)); + if(worldObj.getBlockId(current.x,current.y-1,current.z) != Block.bedrock.id){ + Block block = Block.getBlock(worldObj.getBlockId(current.x,current.y-1,current.z)); + int meta = worldObj.getBlockMetadata(current.x, current.y-1, current.z); + Direction dir = null; + for (Direction direction : Direction.values()) { + if(itemConnections.get(direction) == Connection.OUTPUT || itemConnections.get(direction) == Connection.BOTH){ + if(direction.getTileEntity(worldObj,this) instanceof TileEntityChest){ + dir = direction; + } + } + } + if(dir != null){ + TileEntity tile = dir.getTileEntity(worldObj,this); + ItemStack[] drops = block.getBreakResult(worldObj, EnumDropCause.PROPER_TOOL,xCoord,yCoord,zCoord,meta,tile); + if(tile instanceof TileEntityChest){ + if(drops == null){ + block.dropBlockWithCause(worldObj, EnumDropCause.PROPER_TOOL,xCoord,yCoord+1,zCoord,meta,this); + worldObj.setBlockWithNotify(current.x,current.y-1,current.z,0); + return; + } + for (ItemStack drop : drops) { + int availableSlot = -1; + for (int i = 0; i < ((TileEntityChest) tile).getSizeInventory(); i++) { + ItemStack stack = ((TileEntityChest) tile).getStackInSlot(i); + if(stack == null || (stack.isItemEqual(drop)) && stack.stackSize < stack.getMaxStackSize()) { + availableSlot = i; + break; + } + } + if(availableSlot == -1){ + block.dropBlockWithCause(worldObj, EnumDropCause.PROPER_TOOL,xCoord,yCoord+1,zCoord,meta,this); + worldObj.setBlockWithNotify(current.x,current.y-1,current.z,0); + } else { + ItemStack stack = ((TileEntityChest) tile).getStackInSlot(availableSlot); + if(stack == null){ + ((TileEntityChest) tile).setInventorySlotContents(availableSlot,drop); + } else if (stack.isItemEqual(drop)){ + stack.stackSize+=drop.stackSize; + } + worldObj.setBlockWithNotify(current.x,current.y-1,current.z,0); + } + } + } else { + block.dropBlockWithCause(worldObj, EnumDropCause.PROPER_TOOL,xCoord,yCoord+1,zCoord,meta,this); + worldObj.setBlockWithNotify(current.x,current.y-1,current.z,0); + } + } else { + block.dropBlockWithCause(worldObj, EnumDropCause.PROPER_TOOL,xCoord,yCoord+1,zCoord,meta,this); + worldObj.setBlockWithNotify(current.x,current.y-1,current.z,0); + } + } + } + } + + @Override + public void updateEntity() { + speedMultiplier = 1; + cost = 0; + for(Direction dir : Direction.values()){ + TileEntity tile = dir.getTileEntity(worldObj,this); + if(tile instanceof TileEntityBooster){ + if(((TileEntityBooster) tile).isBurning()){ + int meta = tile.getBlockMetadata(); + if(Direction.getDirectionFromSide(meta).getOpposite() == dir){ + speedMultiplier = 2; + } + } + } + } + extractFluids(); + if(!workTimer.isPaused()){ + workTimer.tick(); + } + if(current.equals(new Vec3i())){ + current = new Vec3i(xCoord-1,yCoord+4,zCoord+1); + } + workTimer.max = progressMaxTicks / speedMultiplier; + } + + @Override + public boolean isBurning() { + return fluidContents[0] != null; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrusher.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrusher.java index 4668e849..1b8f7c83 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrusher.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrusher.java @@ -29,6 +29,7 @@ public void updateEntity() { extractFluids(); BlockContainerTiered block = (BlockContainerTiered) getBlockType(); if(block != null) { + tier = block.tier; switch (block.tier) { case PROTOTYPE: recipes = CrusherRecipes.instance; diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalChamber.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalChamber.java index 17d98974..83107835 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalChamber.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalChamber.java @@ -39,6 +39,7 @@ public void updateEntity() { extractFluids(); BlockContainerTiered block = (BlockContainerTiered) getBlockType(); if(block != null) { + tier = block.tier; switch (block.tier) { case BASIC: recipes = CrystalChamberRecipes.instance; @@ -100,13 +101,13 @@ public boolean fuel(){ public void processItem(){ if(canProcess()){ - int size1 = this.itemContents[0].tag.getInteger("size"); - int sat1 = this.itemContents[0].tag.getInteger("saturation"); - int size2 = this.itemContents[2].tag.getInteger("size"); - int sat2 = this.itemContents[2].tag.getInteger("saturation"); + int size1 = this.itemContents[0].getData().getInteger("size"); + int sat1 = this.itemContents[0].getData().getInteger("saturation"); + int size2 = this.itemContents[2].getData().getInteger("size"); + int sat2 = this.itemContents[2].getData().getInteger("saturation"); ItemStack stack = recipes.getResult(new Integer[]{this.itemContents[2].itemID, this.itemContents[0].itemID}); - stack.tag.putInt("size",size1+size2); - stack.tag.putInt("saturation",sat1+sat2); + stack.getData().putInt("size",size1+size2); + stack.getData().putInt("saturation",sat1+sat2); if(itemContents[1] == null){ setInventorySlotContents(1, stack); } else if(itemContents[1].isItemEqual(stack)) { @@ -135,7 +136,7 @@ private boolean canProcess() { } else { ItemStack c1 = this.itemContents[0]; ItemStack c2 = this.itemContents[2]; - if(c1.tag.getInteger("size") + c2.tag.getInteger("size") > 8){ + if(c1.getData().getInteger("size") + c2.getData().getInteger("size") > 8){ return false; } ItemStack stack = recipes.getResult(new Integer[]{c2.itemID, c1.itemID}); diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalCutter.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalCutter.java index b87cb1af..1405eff2 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalCutter.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityCrystalCutter.java @@ -6,6 +6,7 @@ import net.minecraft.core.item.ItemStack; import sunsetsatellite.fluidapi.api.FluidStack; import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; import sunsetsatellite.signalindustries.interfaces.IBoostable; import sunsetsatellite.signalindustries.recipes.CrystalCutterRecipes; @@ -38,6 +39,10 @@ public void updateEntity() { super.updateEntity(); worldObj.markBlocksDirty(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord); extractFluids(); + BlockContainerTiered block = (BlockContainerTiered) getBlockType(); + if(block != null) { + tier = block.tier; + } boolean update = false; if(fuelBurnTicks > 0){ fuelBurnTicks--; diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityDimensionalAnchor.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityDimensionalAnchor.java index 4277aa21..6d273325 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityDimensionalAnchor.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityDimensionalAnchor.java @@ -101,7 +101,7 @@ public boolean canProcess() { return false; } } - return itemContents[0].getItem() == SignalIndustries.warpOrb && !itemContents[0].tag.containsKey("position"); + return itemContents[0].getItem() == SignalIndustries.warpOrb && !itemContents[0].getData().containsKey("position"); } } @@ -112,7 +112,7 @@ public void processItem() { pos.putInt("x",xCoord); pos.putInt("y",yCoord+1); pos.putInt("z",zCoord); - stack.tag.put("position",pos); + stack.getData().put("position",pos); } } @@ -150,7 +150,7 @@ public boolean isReady() { if(itemContents[0] == null) { return false; } else { - return itemContents[0].getItem() == SignalIndustries.warpOrb && !itemContents[0].tag.containsKey("Data"); + return itemContents[0].getItem() == SignalIndustries.warpOrb && !itemContents[0].getData().containsKey("Data"); } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java new file mode 100644 index 00000000..ad3767da --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExternalIO.java @@ -0,0 +1,225 @@ +package sunsetsatellite.signalindustries.inventories; + +import com.mojang.nbt.CompoundTag; +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 org.jetbrains.annotations.NotNull; +import sunsetsatellite.fluidapi.api.FluidStack; +import sunsetsatellite.fluidapi.api.IFluidInventory; +import sunsetsatellite.fluidapi.api.IFluidTransfer; +import sunsetsatellite.sunsetutils.util.Connection; +import sunsetsatellite.sunsetutils.util.Direction; + +import java.util.ArrayList; + +public class TileEntityExternalIO extends TileEntityTieredMachine { + + public TileEntity externalTile; + public Direction externalTileSide; + + public TileEntityExternalIO(){ + } + + @Override + public int getSizeInventory() { + if(externalTile instanceof IInventory){ + return ((IInventory) externalTile).getSizeInventory(); + } + return 0; + } + + @Override + public ItemStack getStackInSlot(int i1) { + if(externalTile instanceof IInventory) { + return ((IInventory) externalTile).getStackInSlot(i1); + } + return null; + } + + @Override + public ItemStack decrStackSize(int i1, int i2) { + if(externalTile instanceof IInventory) { + return ((IInventory) externalTile).decrStackSize(i1, i2); + } + return null; + } + + @Override + public void setInventorySlotContents(int i1, ItemStack itemStack2) { + if(externalTile instanceof IInventory){ + ((IInventory) externalTile).setInventorySlotContents(i1, itemStack2); + } + } + + @Override + public String getInvName() { + if(externalTile instanceof IInventory){ + return ((IInventory) externalTile).getInvName(); + } + return "External I/O"; + } + + @Override + public void readFromNBT(CompoundTag CompoundTag1) { + if(externalTile != null) { + externalTile.readFromNBT(CompoundTag1); + } + super.readFromNBT(CompoundTag1); + } + + @Override + public void writeToNBT(CompoundTag CompoundTag1) { + if(externalTile != null) { + externalTile.writeToNBT(CompoundTag1); + } + super.writeToNBT(CompoundTag1); + } + + @Override + public int getInventoryStackLimit() { + if(externalTile instanceof IInventory) { + return ((IInventory) externalTile).getInventoryStackLimit(); + } + return 0; + } + + @Override + public boolean canInteractWith(EntityPlayer entityPlayer1) { + if(externalTile instanceof IInventory) { + return ((IInventory) externalTile).canInteractWith(entityPlayer1); + } + return false; + } + + @Override + public void take(@NotNull FluidStack fluidStack, Direction dir) { + if(externalTile instanceof IFluidTransfer){ + ((IFluidTransfer) externalTile).take(fluidStack, dir); + } + } + + @Override + public void give(Direction dir) { + if(externalTile instanceof IFluidTransfer) { + ((IFluidTransfer) externalTile).give(dir); + } + } + + @Override + public FluidStack insertFluid(int slot, FluidStack fluidStack) { + if(externalTile instanceof IFluidInventory){ + return ((IFluidInventory) externalTile).insertFluid(slot, fluidStack); + } + return null; + } + + @Override + public int getRemainingCapacity(int slot) { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getRemainingCapacity(slot); + } + return 0; + } + + @Override + public boolean canInsertFluid(int slot, FluidStack fluidStack) { + if(externalTile instanceof IFluidInventory){ + return ((IFluidInventory) externalTile).canInsertFluid(slot, fluidStack); + } + return false; + } + + @Override + public Connection getConnection(Direction dir) { + if(externalTile instanceof IFluidTransfer) { + return ((IFluidTransfer) externalTile).getConnection(dir); + } + return Connection.NONE; + } + + @Override + public FluidStack getFluidInSlot(int slot) { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getFluidInSlot(slot); + } + return null; + } + + @Override + public int getFluidCapacityForSlot(int slot) { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getFluidCapacityForSlot(slot); + } + return 0; + } + + @Override + public ArrayList getAllowedFluidsForSlot(int slot) { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getAllowedFluidsForSlot(slot); + } + return new ArrayList<>(); + } + + @Override + public void setFluidInSlot(int slot, FluidStack fluid) { + if(externalTile instanceof IFluidInventory) { + ((IFluidInventory) externalTile).setFluidInSlot(slot, fluid); + } + } + + @Override + public int getFluidInventorySize() { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getFluidInventorySize(); + } + return 0; + } + + @Override + public void onFluidInventoryChanged() { + if(externalTile instanceof IFluidInventory) { + ((IFluidInventory) externalTile).onFluidInventoryChanged(); + } + } + + @Override + public int getTransferSpeed() { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getTransferSpeed(); + } + return 0; + } + + @Override + public int getActiveFluidSlot(Direction dir) { + if(externalTile instanceof IFluidInventory) { + return ((IFluidInventory) externalTile).getActiveFluidSlot(dir); + } + return 0; + } + + @Override + public void updateEntity() { + super.updateEntity(); + worldObj.markBlocksDirty(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + if(externalTile == null){ + for (Direction dir : Direction.values()) { + TileEntity tile = dir.getTileEntity(worldObj,this); + if(tile instanceof IInventory || tile instanceof IFluidInventory){ + externalTile = tile; + externalTileSide = dir; + } + } + } else { + if(worldObj.getBlockTileEntity(externalTile.xCoord,externalTile.yCoord,externalTile.zCoord) != externalTile){ + externalTile = null; + externalTileSide = null; + } + } + } + +} diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExtractor.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExtractor.java index 37078be1..a3571443 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExtractor.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityExtractor.java @@ -37,6 +37,7 @@ public void updateEntity() { } BlockContainerTiered block = (BlockContainerTiered) getBlockType(); if(block != null){ + tier = block.tier; switch (block.tier){ case PROTOTYPE: recipes = ExtractorRecipes.instance; diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInfuser.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInfuser.java index 08c39d2f..3cdef5c9 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInfuser.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityInfuser.java @@ -5,6 +5,7 @@ import net.minecraft.core.item.ItemStack; import sunsetsatellite.fluidapi.api.FluidStack; import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; import sunsetsatellite.signalindustries.interfaces.IBoostable; import sunsetsatellite.signalindustries.recipes.InfuserRecipes; import sunsetsatellite.signalindustries.recipes.MachineRecipesBase; @@ -40,6 +41,10 @@ public void updateEntity() { super.updateEntity(); worldObj.markBlocksDirty(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); extractFluids(); + BlockContainerTiered block = (BlockContainerTiered) getBlockType(); + if(block != null) { + tier = block.tier; + } boolean update = false; if (fuelBurnTicks > 0) { fuelBurnTicks--; diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPlateFormer.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPlateFormer.java index 4c100b2f..1f3a355f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPlateFormer.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPlateFormer.java @@ -4,6 +4,7 @@ import net.minecraft.core.block.BlockFluid; import net.minecraft.core.item.ItemStack; import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; import sunsetsatellite.signalindustries.interfaces.IBoostable; import sunsetsatellite.signalindustries.recipes.PlateFormerRecipes; @@ -26,6 +27,10 @@ public void updateEntity() { worldObj.markBlocksDirty(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord); extractFluids(); boolean update = false; + BlockContainerTiered block = (BlockContainerTiered) getBlockType(); + if(block != null) { + tier = block.tier; + } if(fuelBurnTicks > 0){ fuelBurnTicks--; } @@ -79,7 +84,7 @@ public void processItem(){ if(itemContents[1] == null){ setInventorySlotContents(1, stack); } else if(itemContents[1].isItemEqual(stack)) { - itemContents[1].stackSize++; + itemContents[1].stackSize += stack.stackSize; } if(this.itemContents[0].getItem().hasContainerItem()) { this.itemContents[0] = new ItemStack(this.itemContents[0].getItem().getContainerItem()); diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPump.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPump.java index 730c2221..4dc66cf6 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPump.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityPump.java @@ -5,6 +5,7 @@ import net.minecraft.core.block.BlockFluid; import sunsetsatellite.fluidapi.api.FluidStack; import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; import sunsetsatellite.signalindustries.interfaces.IBoostable; import sunsetsatellite.signalindustries.recipes.MachineRecipesBase; import sunsetsatellite.signalindustries.recipes.PumpRecipes; @@ -42,6 +43,10 @@ public void updateEntity() { super.updateEntity(); worldObj.markBlocksDirty(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); extractFluids(); + BlockContainerTiered block = (BlockContainerTiered) getBlockType(); + if(block != null) { + tier = block.tier; + } if(currentBlock == null){ Set pumpableFluids = recipes.getRecipeList().keySet(); for(int x = xCoord-range; x < xCoord+range; x++){ diff --git a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityTieredMachine.java b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityTieredMachine.java index a110fb8f..b5750112 100644 --- a/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityTieredMachine.java +++ b/src/main/java/sunsetsatellite/signalindustries/inventories/TileEntityTieredMachine.java @@ -7,12 +7,14 @@ import sunsetsatellite.signalindustries.blocks.BlockContainerTiered; import sunsetsatellite.sunsetutils.util.Connection; import sunsetsatellite.sunsetutils.util.Direction; +import sunsetsatellite.sunsetutils.util.IFluidIO; +import sunsetsatellite.sunsetutils.util.IItemIO; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -public class TileEntityTieredMachine extends TileEntityTiered { +public class TileEntityTieredMachine extends TileEntityTiered implements IFluidIO, IItemIO { public int fuelBurnTicks = 0; public int fuelMaxBurnTicks = 0; public int progressTicks = 0; @@ -129,4 +131,24 @@ public int getBurnTimeRemainingScaled(int paramInt) { } return this.fuelBurnTicks * paramInt / this.fuelMaxBurnTicks; } + + @Override + public int getActiveFluidSlotForSide(Direction dir) { + return activeFluidSlots.get(dir); + } + + @Override + public Connection getFluidIOForSide(Direction dir) { + return connections.get(dir); + } + + @Override + public int getActiveItemSlotForSide(Direction dir) { + return activeItemSlots.get(dir); + } + + @Override + public Connection getItemIOForSide(Direction dir) { + return itemConnections.get(dir); + } } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java index 64adfc12..805f8592 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java @@ -31,13 +31,13 @@ public ItemPulsar(int i, Tier tier) { public String getDescription(ItemStack stack) { String text = super.getDescription(stack); String ability = getAbility(stack); - text += "\nCharge: "+ (stack.tag.getByte("charge") >= 100 ? TextFormatting.RED : TextFormatting.LIGHT_GRAY) +stack.tag.getByte("charge")+"%"+TextFormatting.WHITE+" | Ability: "+ability; + text += "\nCharge: "+ (stack.getData().getByte("charge") >= 100 ? TextFormatting.RED : TextFormatting.LIGHT_GRAY) +stack.getData().getByte("charge")+"%"+TextFormatting.WHITE+" | Ability: "+ability; return text; } @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) { - if(entityplayer.isSneaking() && !itemstack.tag.getBoolean("charging")){ + if(entityplayer.isSneaking() && !itemstack.getData().getBoolean("charging")){ SignalIndustries.displayGui(entityplayer,new GuiPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryPulsar(entityplayer.inventory.getCurrentItem()),itemstack); return true; } @@ -46,12 +46,12 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World w @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if(!itemstack.tag.getBoolean("charging") && itemstack.tag.getByte("charge") < 100 && !entityplayer.isSneaking() && getFluidStack(0,itemstack).getInteger("amount") > 0) { - itemstack.tag.putBoolean("charging", true); + if(!itemstack.getData().getBoolean("charging") && itemstack.getData().getByte("charge") < 100 && !entityplayer.isSneaking() && getFluidStack(0,itemstack).getInteger("amount") > 0) { + itemstack.getData().putBoolean("charging", true); return itemstack; } - if(itemstack.tag.getByte("charge") >= 100){ - itemstack.tag.putByte("charge", (byte) 0); + if(itemstack.getData().getByte("charge") >= 100){ + itemstack.getData().putByte("charge", (byte) 0); world.playSoundAtEntity(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); @@ -66,7 +66,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer } else { SignalIndustries.usePortal(SignalIndustries.dimEternity.id); } - ((INBTCompound)itemstack.tag.getCompound("inventory")).removeTag(String.valueOf(0)); + ((INBTCompound)itemstack.getData().getCompound("inventory")).removeTag(String.valueOf(0)); } else { world.spawnParticle("pulse_shockwave", entityplayer.x, entityplayer.y, entityplayer.z, 0.0, 0.0, 0.0); } @@ -77,14 +77,14 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer @Override public void inventoryTick(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { - boolean charging = itemstack.tag.getBoolean("charging"); - byte charge = itemstack.tag.getByte("charge"); + boolean charging = itemstack.getData().getBoolean("charging"); + byte charge = itemstack.getData().getByte("charge"); int energy = getFluidStack(0,itemstack).getInteger("amount"); - if(itemstack.tag.getBoolean("charging")){ + if(itemstack.getData().getBoolean("charging")){ if(charge < 100){ if(energy <= 0){ getFluidStack(0,itemstack).putInt("amount",0); - itemstack.tag.putBoolean("charging",false); + itemstack.getData().putBoolean("charging",false); Minecraft.getMinecraft(Minecraft.class).ingameGUI.addChatMessage(TextFormatting.WHITE+"The Pulsar> "+TextFormatting.RED+" ERROR: "+TextFormatting.WHITE+"Ran out of energy while charging!"); return; } @@ -93,9 +93,9 @@ public void inventoryTick(ItemStack itemstack, World world, Entity entity, int i } else { getFluidStack(0,itemstack).putInt("amount",energy-40); //charging takes 100 ticks } - itemstack.tag.putByte("charge", (byte) (charge+1)); + itemstack.getData().putByte("charge", (byte) (charge+1)); } else { - itemstack.tag.putBoolean("charging",false); + itemstack.getData().putBoolean("charging",false); } } @@ -104,16 +104,16 @@ public void inventoryTick(ItemStack itemstack, World world, Entity entity, int i @Override public int getIconIndex(ItemStack itemstack) { - if(getFluidStack(0,itemstack).getInteger("amount") <= 0 && itemstack.tag.getByte("charge") <= 0){ + if(getFluidStack(0,itemstack).getInteger("amount") <= 0 && itemstack.getData().getByte("charge") <= 0){ return Item.iconCoordToIndex(SignalIndustries.pulsarTex[0][0],SignalIndustries.pulsarTex[0][1]); } int tex = Item.iconCoordToIndex(SignalIndustries.pulsarTex[1][0],SignalIndustries.pulsarTex[1][1]); - if(itemstack.tag.getByte("charge") >= 100){ + if(itemstack.getData().getByte("charge") >= 100){ tex = Item.iconCoordToIndex(SignalIndustries.pulsarTex[2][0],SignalIndustries.pulsarTex[2][1]); } if(getItemIdFromSlot(0,itemstack) == SignalIndustries.warpOrb.id){ tex = Item.iconCoordToIndex(SignalIndustries.pulsarTex[3][0],SignalIndustries.pulsarTex[3][1]); - if(itemstack.tag.getByte("charge") >= 100){ + if(itemstack.getData().getByte("charge") >= 100){ tex = Item.iconCoordToIndex(SignalIndustries.pulsarTex[4][0],SignalIndustries.pulsarTex[4][1]); } } @@ -121,15 +121,15 @@ public int getIconIndex(ItemStack itemstack) { } public int getItemIdFromSlot(int id, ItemStack stack){ - return stack.tag.getCompound("inventory").getCompound(String.valueOf(id)).getShort("id"); + return stack.getData().getCompound("inventory").getCompound(String.valueOf(id)).getShort("id"); } public CompoundTag getItemFromSlot(int id, ItemStack stack){ - return stack.tag.getCompound("inventory").getCompound(String.valueOf(id)); + return stack.getData().getCompound("inventory").getCompound(String.valueOf(id)); } public CompoundTag getFluidStack(int id, ItemStack stack){ - return stack.tag.getCompound("fluidInventory").getCompound(String.valueOf(id)); + return stack.getData().getCompound("fluidInventory").getCompound(String.valueOf(id)); } public String getAbility(ItemStack stack){ @@ -145,7 +145,7 @@ public void renderOverlay(GuiIngame guiIngame, EntityPlayer player, int height, fontRenderer.drawStringWithShadow("Ability: ", 4, i += 16, 0xFFFFFFFF); fontRenderer.drawStringWithShadow(((ItemPulsar) pulsar.getItem()).getAbility(pulsar), 4 + fontRenderer.getStringWidth("Ability: "), i, 0xFFFF0000); fontRenderer.drawStringWithShadow("Charge: ", 4, i += 10, 0xFFFFFFFF); - fontRenderer.drawStringWithShadow(String.valueOf(pulsar.tag.getByte("charge")) + "%", 4 + fontRenderer.getStringWidth("Charge: "), i, pulsar.tag.getByte("charge") >= 100 ? 0xFFFF0000 : 0xFFFFFFFF); + fontRenderer.drawStringWithShadow(String.valueOf(pulsar.getData().getByte("charge")) + "%", 4 + fontRenderer.getStringWidth("Charge: "), i, pulsar.getData().getByte("charge") >= 100 ? 0xFFFF0000 : 0xFFFFFFFF); fontRenderer.drawStringWithShadow("Energy: ", 4, i += 10, 0xFFFFFFFF); fontRenderer.drawStringWithShadow(String.valueOf(((ItemPulsar) pulsar.getItem()).getFluidStack(0, pulsar).getInteger("amount")), 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumCrystal.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumCrystal.java index 50a1bc6b..9802ebd4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumCrystal.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumCrystal.java @@ -26,7 +26,7 @@ public ItemSignalumCrystal(int id) { public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if(itemstack.getItem().id != SignalIndustries.signalumCrystalEmpty.id){ itemstack.consumeItem(entityplayer); - world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + //world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!world.isClientSide) { world.entityJoinedWorld(new EntityCrystal(world, entityplayer)); } @@ -37,12 +37,12 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer @Override public int getCapacity(ItemStack stack) { - return stack.tag.getInteger("size")*1000; + return stack.getData().getInteger("size")*1000; } @Override public int getRemainingCapacity(ItemStack stack) { - return (stack.tag.getInteger("size")*1000)-stack.tag.getInteger("saturation"); + return (stack.getData().getInteger("size")*1000)-stack.getData().getInteger("saturation"); } @Override @@ -62,9 +62,9 @@ public ItemStack fill(SlotFluid slot, ItemStack stack) { } if(slot.getFluidStack().getLiquid() == SignalIndustries.energyFlowing){ int remaining = getRemainingCapacity(stack); - int saturation = stack.tag.getInteger("saturation"); + int saturation = stack.getData().getInteger("saturation"); int amount = slot.getFluidStack().amount; - int size = stack.tag.getInteger("size"); + int size = stack.getData().getInteger("size"); ItemStack crystal = new ItemStack(SignalIndustries.signalumCrystal,1); if(remaining == 0){ return null; @@ -77,14 +77,14 @@ public ItemStack fill(SlotFluid slot, ItemStack stack) { CompoundTag data = new CompoundTag(); data.putInt("size",size); data.putInt("saturation",getCapacity(stack)); - crystal.tag = data; + crystal.setData(data); return crystal; } else { slot.putStack(null); CompoundTag data = new CompoundTag(); data.putInt("size",size); data.putInt("saturation",saturation + amount); - crystal.tag = data; + crystal.setData(data); return crystal; } } @@ -103,9 +103,9 @@ public ItemStack fill(int slotIndex, ItemInventoryFluid inv, ItemStack stack) { @Override public void drain(ItemStack stack, SlotFluid slot, TileEntityFluidContainer tile) { - int saturation = stack.tag.getInteger("saturation"); + int saturation = stack.getData().getInteger("saturation"); int capacity = tile.getFluidCapacityForSlot(slot.slotNumber); - int size = stack.tag.getInteger("size"); + int size = stack.getData().getInteger("size"); if(saturation == 0){ stack.itemID = SignalIndustries.signalumCrystalEmpty.id; return; @@ -115,12 +115,12 @@ public void drain(ItemStack stack, SlotFluid slot, TileEntityFluidContainer tile if(amount + saturation > capacity){ int remainder = (amount+saturation)-capacity; slot.getFluidStack().amount = capacity; - stack.tag.putInt("saturation",remainder); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",remainder); + stack.getData().putInt("size",size); } else { slot.getFluidStack().amount += saturation; - stack.tag.putInt("saturation",0); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",0); + stack.getData().putInt("size",size); stack.itemID = SignalIndustries.signalumCrystalEmpty.id; } } else { @@ -128,13 +128,13 @@ public void drain(ItemStack stack, SlotFluid slot, TileEntityFluidContainer tile int remainder = saturation-capacity; FluidStack fluid = new FluidStack((BlockFluid) SignalIndustries.energyFlowing,capacity); slot.putStack(fluid); - stack.tag.putInt("saturation",remainder); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",remainder); + stack.getData().putInt("size",size); } else { FluidStack fluid = new FluidStack((BlockFluid) SignalIndustries.energyFlowing,saturation); slot.putStack(fluid); - stack.tag.putInt("saturation",0); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",0); + stack.getData().putInt("size",size); stack.itemID = SignalIndustries.signalumCrystalEmpty.id; } } @@ -147,9 +147,9 @@ public void drain(ItemStack stack, FluidStack fluid, TileEntityFluidContainer ti @Override public void drain(ItemStack stack, SlotFluid slot, ItemInventoryFluid inv) { - int saturation = stack.tag.getInteger("saturation"); + int saturation = stack.getData().getInteger("saturation"); int capacity = inv.getFluidCapacityForSlot(slot.slotNumber); - int size = stack.tag.getInteger("size"); + int size = stack.getData().getInteger("size"); if(saturation == 0){ stack.itemID = SignalIndustries.signalumCrystalEmpty.id; return; @@ -159,12 +159,12 @@ public void drain(ItemStack stack, SlotFluid slot, ItemInventoryFluid inv) { if(amount + saturation > capacity){ int remainder = (amount+saturation)-capacity; slot.getFluidStack().amount = capacity; - stack.tag.putInt("saturation",remainder); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",remainder); + stack.getData().putInt("size",size); } else { slot.getFluidStack().amount += saturation; - stack.tag.putInt("saturation",0); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",0); + stack.getData().putInt("size",size); stack.itemID = SignalIndustries.signalumCrystalEmpty.id; } } else { @@ -172,13 +172,13 @@ public void drain(ItemStack stack, SlotFluid slot, ItemInventoryFluid inv) { int remainder = saturation-capacity; FluidStack fluid = new FluidStack((BlockFluid) SignalIndustries.energyFlowing,capacity); slot.putStack(fluid); - stack.tag.putInt("saturation",remainder); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",remainder); + stack.getData().putInt("size",size); } else { FluidStack fluid = new FluidStack((BlockFluid) SignalIndustries.energyFlowing,saturation); slot.putStack(fluid); - stack.tag.putInt("saturation",0); - stack.tag.putInt("size",size); + stack.getData().putInt("saturation",0); + stack.getData().putInt("size",size); stack.itemID = SignalIndustries.signalumCrystalEmpty.id; } } @@ -191,9 +191,9 @@ public void drain(ItemStack stack, FluidStack fluid, ItemInventoryFluid inv) { @Override public String getDescription(ItemStack stack) { StringBuilder text = new StringBuilder(); - text.append("Size: ").append(stack.tag.getInteger("size")); + text.append("Size: ").append(stack.getData().getInteger("size")); if(stack.getItem().id == SignalIndustries.signalumCrystal.id){ - text.append(" | ").append("Saturation: ").append(stack.tag.getInteger("saturation")); + text.append(" | ").append("Saturation: ").append(stack.getData().getInteger("saturation")); } return text.toString(); } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumDrill.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumDrill.java new file mode 100644 index 00000000..7786e922 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumDrill.java @@ -0,0 +1,232 @@ +package sunsetsatellite.signalindustries.items; + +import com.mojang.nbt.CompoundTag; +import net.minecraft.client.Minecraft; +import net.minecraft.core.block.Block; +import net.minecraft.core.entity.EntityLiving; +import net.minecraft.core.entity.player.EntityPlayer; +import net.minecraft.core.item.ItemStack; +import net.minecraft.core.item.material.ToolMaterial; +import net.minecraft.core.item.tool.ItemToolPickaxe; +import net.minecraft.core.net.command.TextFormatting; +import net.minecraft.core.util.helper.Axis; +import net.minecraft.core.util.helper.Side; +import sunsetsatellite.fluidapi.api.FluidStack; +import sunsetsatellite.fluidapi.api.IItemFluidContainer; +import sunsetsatellite.fluidapi.api.ItemInventoryFluid; +import sunsetsatellite.fluidapi.api.SlotFluid; +import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidContainer; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.interfaces.ITiered; +import sunsetsatellite.signalindustries.util.Tier; + +public class ItemSignalumDrill extends ItemToolPickaxe implements ITiered, IItemFluidContainer { + + public Tier tier; + public int blockDestroyCost; + public ItemSignalumDrill(String name, int id, Tier tier, ToolMaterial enumtoolmaterial) { + super(name, id, enumtoolmaterial); + this.tier = tier; + blockDestroyCost = 5 * tier.ordinal(); + } + + public enum DrillMode{ + NORMAL, + X3 + } + + @Override + public Tier getTier() { + return tier; + } + + @Override + public String getDescription(ItemStack stack) { + return "Tier: " + tier.getColor() + tier.getRank()+"\n"+"Mode: "+getModeString(stack)+"\n"+"Energy: "+ TextFormatting.RED+stack.getData().getInteger("energy")+"/"+getCapacity(stack)+TextFormatting.WHITE; + } + + public String getModeString(ItemStack stack){ + DrillMode mode = getMode(stack); + switch (mode){ + case NORMAL: + return TextFormatting.GRAY+"Normal"; + case X3: + return TextFormatting.RED+"3x3"; + } + return TextFormatting.GRAY+"Normal"; + } + + public DrillMode getMode(ItemStack stack) { + try { + return DrillMode.valueOf(stack.getData().getString("mode")); + } catch (IllegalArgumentException e){ + return DrillMode.NORMAL; + } + } + + public void setMode(ItemStack stack, DrillMode mode){ + stack.getData().putString("mode",mode.toString()); + } + + + @Override + public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) { + int energy = itemstack.getData().getInteger("energy"); + Minecraft mc = Minecraft.getMinecraft(Minecraft.class); + Side side = mc.objectMouseOver.side; + DrillMode mode = getMode(itemstack); + switch (mode) { + case NORMAL: + if(energy >= blockDestroyCost) { + itemstack.getData().putInt("energy", energy - blockDestroyCost); + } + break; + case X3: + if(side.getAxis() == Axis.Y){ + for (int x = -1; x <= 1; x++) { + for (int z = -1; z <= 1; z++) { + Block block = mc.theWorld.getBlock(j+x,k,l+z); + if(block != null && entityliving instanceof EntityPlayer){ + if(energy >= blockDestroyCost) { + itemstack.getData().putInt("energy", energy - blockDestroyCost); + energy = itemstack.getData().getInteger("energy"); + int meta = mc.theWorld.getBlockMetadata(j+x,k,l+z); + if(((EntityPlayer) entityliving).canHarvestBlock(block)){ + block.harvestBlock(mc.theWorld, (EntityPlayer) entityliving,j+x,k,l+z,meta,null); + mc.theWorld.setBlockWithNotify(j+x,k,l+z,0); + } + } + } + } + } + } else if (side.getAxis() == Axis.Z) { + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + Block block = mc.theWorld.getBlock(j+x,k+y,l); + if(block != null && entityliving instanceof EntityPlayer){ + if(energy >= blockDestroyCost) { + itemstack.getData().putInt("energy", energy - blockDestroyCost); + energy = itemstack.getData().getInteger("energy"); + int meta = mc.theWorld.getBlockMetadata(j+x,k+y,l); + if(((EntityPlayer) entityliving).canHarvestBlock(block)){ + block.harvestBlock(mc.theWorld, (EntityPlayer) entityliving,j+x,k+y,l,meta,null); + mc.theWorld.setBlockWithNotify(j+x,k+y,l,0); + } + } + } + } + } + } else if (side.getAxis() == Axis.X) { + for (int z = -1; z <= 1; z++) { + for (int y = -1; y <= 1; y++) { + Block block = mc.theWorld.getBlock(j,k+y,l+z); + if(block != null && entityliving instanceof EntityPlayer){ + if(energy >= blockDestroyCost) { + itemstack.getData().putInt("energy", energy - blockDestroyCost); + energy = itemstack.getData().getInteger("energy"); + int meta = mc.theWorld.getBlockMetadata(j,k+y,l+z); + if(((EntityPlayer) entityliving).canHarvestBlock(block)){ + block.harvestBlock(mc.theWorld, (EntityPlayer) entityliving,j,k+y,l+z,meta,null); + mc.theWorld.setBlockWithNotify(j,k+y,l+z,0); + } + } + } + } + } + } + break; + } + + return true; + } + + @Override + public float getStrVsBlock(ItemStack itemstack, Block block) { + float superValue = super.getStrVsBlock(itemstack,block); + if(superValue == 1.0f) return 1.0f; + if(itemstack.getData().getInteger("energy") >= blockDestroyCost){ + return this.material.getEfficiency(false); + } else { + return 1.0f; + } + } + + @Override + public int getCapacity(ItemStack stack) { + return 4000 * tier.ordinal(); + } + + @Override + public int getRemainingCapacity(ItemStack stack) { + return getCapacity(stack)-stack.getData().getInteger("energy"); + } + + @Override + public boolean canFill(ItemStack stack) { + return getRemainingCapacity(stack) > 0; + } + + @Override + public boolean canDrain(ItemStack stack) { + return false; + } + + @Override + public ItemStack fill(SlotFluid slot, ItemStack stack) { + if(slot.getFluidStack() == null){ + return null; + } + if(slot.getFluidStack().getLiquid() == SignalIndustries.energyFlowing){ + int remaining = getRemainingCapacity(stack); + int saturation = stack.getData().getInteger("energy"); + int amount = slot.getFluidStack().amount; + if(remaining == 0){ + return null; + } + if(amount > remaining){ + slot.getFluidStack().amount -= remaining; + if(slot.getFluidStack().amount <= 0){ + slot.putStack(null); + } + CompoundTag data = new CompoundTag(); + data.putInt("energy",getCapacity(stack)); + stack.setData(data); + return stack; + } else { + slot.putStack(null); + CompoundTag data = new CompoundTag(); + data.putInt("energy",saturation + amount); + stack.setData(data); + return stack; + } + } + return null; + } + + @Override + public ItemStack fill(int slotIndex, TileEntityFluidContainer tile, ItemStack stack) { + return null; + } + + @Override + public ItemStack fill(int slotIndex, ItemInventoryFluid inv, ItemStack stack) { + return null; + } + + @Override + public void drain(ItemStack stack, SlotFluid slot, TileEntityFluidContainer tile) { + } + + @Override + public void drain(ItemStack stack, FluidStack fluid, TileEntityFluidContainer tile) { + + } + + @Override + public void drain(ItemStack stack, SlotFluid slot, ItemInventoryFluid inv) { + } + + @Override + public void drain(ItemStack stack, FluidStack fluid, ItemInventoryFluid inv) { + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java index 1f52f30d..f6691c7c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java @@ -42,7 +42,7 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World w } public CompoundTag getFluidStack(int id, ItemStack stack){ - return stack.tag.getCompound("fluidInventory").getCompound(String.valueOf(id)); + return stack.getData().getCompound("fluidInventory").getCompound(String.valueOf(id)); } @Override @@ -54,16 +54,16 @@ public void renderOverlay(GuiIngame guiIngame, EntityPlayer player, int height, fontRenderer.drawStringWithShadow( "S. P. Harness", 4, i += 16, 0xFFFF0000); if (inv.getCurrentItem() != null && inv.getCurrentItem().getItem() instanceof ItemTrigger){ ItemStack trigger = inv.getCurrentItem(); - if(!Objects.equals(trigger.tag.getString("ability"), "")){ - if(armor.tag.getInteger("cooldown"+trigger.tag.getString("ability")) <= 0){ + if(!Objects.equals(trigger.getData().getString("ability"), "")){ + if(armor.getData().getInteger("cooldown"+trigger.getData().getString("ability")) <= 0){ fontRenderer.drawStringWithShadow( "Ability: ", 4, i += 16, 0xFFFFFFFF); - fontRenderer.drawStringWithShadow( trigger.tag.getString("ability")+ TextFormatting.LIME+" READY", 4 + fontRenderer.getStringWidth("Ability: "), i, 0xFFFF0000); + fontRenderer.drawStringWithShadow( trigger.getData().getString("ability")+ TextFormatting.LIME+" READY", 4 + fontRenderer.getStringWidth("Ability: "), i, 0xFFFF0000); } else { fontRenderer.drawStringWithShadow( "Ability: ", 4, i += 16, 0xFFFFFFFF); - fontRenderer.drawStringWithShadow( trigger.tag.getString("ability")+ TextFormatting.RED+" "+armor.tag.getInteger("cooldown"+trigger.tag.getString("ability"))+"s", 4 + fontRenderer.getStringWidth("Ability: "), i, 0xFF808080); + fontRenderer.drawStringWithShadow( trigger.getData().getString("ability")+ TextFormatting.RED+" "+armor.getData().getInteger("cooldown"+trigger.getData().getString("ability"))+"s", 4 + fontRenderer.getStringWidth("Ability: "), i, 0xFF808080); } fontRenderer.drawStringWithShadow( "Energy: ", 4, i += 10, 0xFFFFFFFF); - fontRenderer.drawStringWithShadow( String.valueOf(((ItemSignalumPrototypeHarness) armor.getItem()).getFluidStack(0, armor).getInteger("amount"))+TextFormatting.RED+"-"+ ItemTrigger.abilities.get(trigger.tag.getString("ability")).cost, 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); + fontRenderer.drawStringWithShadow( String.valueOf(((ItemSignalumPrototypeHarness) armor.getItem()).getFluidStack(0, armor).getInteger("amount"))+TextFormatting.RED+"-"+ ItemTrigger.abilities.get(trigger.getData().getString("ability")).cost, 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); } else { fontRenderer.drawStringWithShadow( "Energy: ", 4, i += 16, 0xFFFFFFFF); fontRenderer.drawStringWithShadow( String.valueOf(((ItemSignalumPrototypeHarness) armor.getItem()).getFluidStack(0, armor).getInteger("amount")), 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); @@ -85,7 +85,7 @@ public void inventoryTick(ItemStack itemstack, World world, Entity entity, int i cooldownTicks++; if(cooldownTicks >= 20){ cooldownTicks = 0; - Collection> tags = itemstack.tag.getValues(); + Collection> tags = itemstack.getData().getValues(); tags.forEach((NBT)->{ if(NBT instanceof IntTag){ if(NBT.getTagName().contains("cooldown")){ diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumSaber.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumSaber.java index 9edbd14b..cf49adfd 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumSaber.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumSaber.java @@ -38,7 +38,7 @@ public ItemSignalumSaber(String key, int i, Tier tier, ToolMaterial enumtoolmate @Override public String getDescription(ItemStack stack) { - return "Tier: " + tier.getColor() + tier.getRank()+"\n"+"Energy: "+ TextFormatting.RED+stack.tag.getInteger("energy")+TextFormatting.WHITE; + return "Tier: " + tier.getColor() + tier.getRank()+"\n"+"Energy: "+ TextFormatting.RED+stack.getData().getInteger("energy")+TextFormatting.WHITE; } @Override @@ -48,7 +48,7 @@ public int getCapacity(ItemStack stack) { @Override public int getRemainingCapacity(ItemStack stack) { - return 500-stack.tag.getInteger("energy"); + return 500-stack.getData().getInteger("energy"); } @Override @@ -63,15 +63,15 @@ public boolean canDrain(ItemStack stack) { @Override public boolean hitEntity(ItemStack itemstack, EntityLiving victim, EntityLiving attacker) { - int energy = itemstack.tag.getInteger("energy"); - if(itemstack.tag.getBoolean("active")){ + int energy = itemstack.getData().getInteger("energy"); + if(itemstack.getData().getBoolean("active")){ if(energy > 0){ - itemstack.tag.putInt("energy",energy-1); + itemstack.getData().putInt("energy",energy-1); victim.remainingFireTicks = 60; } } if(energy <= 0){ - itemstack.tag.putBoolean("active",false); + itemstack.getData().putBoolean("active",false); } return true; } @@ -79,10 +79,10 @@ public boolean hitEntity(ItemStack itemstack, EntityLiving victim, EntityLiving @Override public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) { Block block = Block.blocksList[i]; - int energy = itemstack.tag.getInteger("energy"); + int energy = itemstack.getData().getInteger("energy"); if (block != null && block.getHardness() > 0.0F){ - if(energy > 1 && itemstack.tag.getBoolean("active")){ - itemstack.tag.putInt("energy",energy-2); + if(energy > 1 && itemstack.getData().getBoolean("active")){ + itemstack.getData().putInt("energy",energy-2); } } return true; @@ -90,7 +90,7 @@ public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, @Override public int getIconIndex(ItemStack itemstack) { - if(itemstack.tag.getBoolean("active")){ + if(itemstack.getData().getBoolean("active")){ return Item.iconCoordToIndex(SignalIndustries.saberTex[1][0],SignalIndustries.saberTex[1][1]); } return Item.iconCoordToIndex(SignalIndustries.saberTex[0][0],SignalIndustries.saberTex[0][1]); @@ -103,9 +103,9 @@ public ItemStack fill(SlotFluid slot, ItemStack stack) { } if(slot.getFluidStack().getLiquid() == SignalIndustries.energyFlowing){ int remaining = getRemainingCapacity(stack); - int saturation = stack.tag.getInteger("energy"); + int saturation = stack.getData().getInteger("energy"); int amount = slot.getFluidStack().amount; - //int size = stack.tag.getInteger("size"); + //int size = stack.getData().getInteger("size"); //ItemStack crystal = new ItemStack(SignalIndustries.signalumCrystal,1); if(remaining == 0){ return null; @@ -118,14 +118,14 @@ public ItemStack fill(SlotFluid slot, ItemStack stack) { CompoundTag data = new CompoundTag(); //data.putInt("size",size); data.putInt("energy",getCapacity(stack)); - stack.tag = data; + stack.setData(data); return stack; } else { slot.putStack(null); CompoundTag data = new CompoundTag(); //data.putInt("size",size); data.putInt("energy",saturation + amount); - stack.tag = data; + stack.setData(data); return stack; } } @@ -161,7 +161,7 @@ public void drain(ItemStack stack, FluidStack fluid, ItemInventoryFluid inv) { @Override public int getDamageVsEntity(Entity entity, ItemStack stack) { - if(stack.tag.getBoolean("active")){ + if(stack.getData().getBoolean("active")){ return 10; } else { return 4; @@ -170,8 +170,8 @@ public int getDamageVsEntity(Entity entity, ItemStack stack) { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if(itemstack.tag.getInteger("energy") > 0){ - itemstack.tag.putBoolean("active",!itemstack.tag.getBoolean("active")); + if(itemstack.getData().getInteger("energy") > 0){ + itemstack.getData().putBoolean("active",!itemstack.getData().getBoolean("active")); } return super.onItemRightClick(itemstack, world, entityplayer); } @@ -183,8 +183,8 @@ public void renderOverlay(GuiIngame guiIngame, EntityPlayer player, int height, int i = (inv.armorItemInSlot(2) != null && inv.armorItemInSlot(2).getItem() instanceof ItemSignalumPrototypeHarness) ? height - 128 : height - 64; fontRenderer.drawStringWithShadow("Signalum Saber", 4, i += 16, 0xFFFF0000); fontRenderer.drawStringWithShadow("Energy: ", 4, i += 16, 0xFFFFFFFF); - fontRenderer.drawStringWithShadow(String.valueOf(saber.tag.getInteger("energy")), 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); - fontRenderer.drawStringWithShadow(saber.tag.getBoolean("active") ? "Active" : "Inactive", 4, i +=10, saber.tag.getBoolean("active") ? 0xFF00FF00 : 0xFF808080); + fontRenderer.drawStringWithShadow(String.valueOf(saber.getData().getInteger("energy")), 4 + fontRenderer.getStringWidth("Energy: "), i, 0xFFFF8080); + fontRenderer.drawStringWithShadow(saber.getData().getBoolean("active") ? "Active" : "Inactive", 4, i +=10, saber.getData().getBoolean("active") ? 0xFF00FF00 : 0xFF808080); } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemTrigger.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemTrigger.java index 4b2ce040..778ea4e6 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemTrigger.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemTrigger.java @@ -34,20 +34,20 @@ public String getDescription(ItemStack stack) { } public TriggerBaseAbility getAbility(ItemStack stack){ - if(stack.tag.containsKey("ability") && abilities.containsKey(stack.tag.getString("ability"))){ - return abilities.get(stack.tag.getString("ability")); + if(stack.getData().containsKey("ability") && abilities.containsKey(stack.getData().getString("ability"))){ + return abilities.get(stack.getData().getString("ability")); } return null; } public String getAbilityName(ItemStack stack){ - return stack.tag.getString("ability"); + return stack.getData().getString("ability"); } @Override public String getLanguageKey(ItemStack stack) { if(getAbility(stack) != null){ - return "item.signalindustries.trigger"+stack.tag.getString("ability"); + return "item.signalindustries.trigger"+stack.getData().getString("ability"); } else { return "item.signalindustries.triggerNull"; } @@ -58,13 +58,13 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World w if(getAbility(itemstack) != null) { if (entityplayer.inventory.armorItemInSlot(2) != null && entityplayer.inventory.armorItemInSlot(2).getItem() instanceof ItemSignalumPrototypeHarness) { ItemStack harness = entityplayer.inventory.armorItemInSlot(2); - if (harness.tag.getInteger("cooldown" + getAbilityName(itemstack)) <= 0) { + if (harness.getData().getInteger("cooldown" + getAbilityName(itemstack)) <= 0) { CompoundTag energy = ((ItemSignalumPrototypeHarness) harness.getItem()).getFluidStack(0, harness); int amount = energy.getInteger("amount"); if (amount >= getAbility(itemstack).cost) { getAbility(itemstack).activate(blockX, blockY, blockZ, entityplayer, world, itemstack); energy.putInt("amount", amount - getAbility(itemstack).cost); - harness.tag.putInt("cooldown" + getAbilityName(itemstack), getAbility(itemstack).cooldown); + harness.getData().putInt("cooldown" + getAbilityName(itemstack), getAbility(itemstack).cooldown); } } } @@ -77,13 +77,13 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer if(getAbility(itemstack) != null){ if(entityplayer.inventory.armorItemInSlot(2) != null && entityplayer.inventory.armorItemInSlot(2).getItem() instanceof ItemSignalumPrototypeHarness){ ItemStack harness = entityplayer.inventory.armorItemInSlot(2); - if(harness.tag.getInteger("cooldown"+getAbilityName(itemstack)) <= 0){ + if(harness.getData().getInteger("cooldown"+getAbilityName(itemstack)) <= 0){ CompoundTag energy = ((ItemSignalumPrototypeHarness)harness.getItem()).getFluidStack(0,harness); int amount = energy.getInteger("amount"); if(amount >= getAbility(itemstack).cost){ getAbility(itemstack).activate(entityplayer,world,itemstack); energy.putInt("amount",amount-getAbility(itemstack).cost); - harness.tag.putInt("cooldown"+getAbilityName(itemstack),getAbility(itemstack).cooldown); + harness.getData().putInt("cooldown"+getAbilityName(itemstack),getAbility(itemstack).cooldown); } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemWarpOrb.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemWarpOrb.java index 535a9409..59061943 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemWarpOrb.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemWarpOrb.java @@ -14,7 +14,7 @@ public ItemWarpOrb(int i) { @Override public String getDescription(ItemStack stack) { - CompoundTag warpPosition = stack.tag.getCompound("position"); + CompoundTag warpPosition = stack.getData().getCompound("position"); if(warpPosition.containsKey("x") && warpPosition.containsKey("y") && warpPosition.containsKey("z")){ return String.format("Points to: %sX: %s Y: %s Z: %s%s",TextFormatting.MAGENTA,warpPosition.getInteger("x"),warpPosition.getInteger("y"),warpPosition.getInteger("z"), TextFormatting.WHITE); } diff --git a/src/main/java/sunsetsatellite/signalindustries/misc/SignalIndustriesAchievementPage.java b/src/main/java/sunsetsatellite/signalindustries/misc/SignalIndustriesAchievementPage.java new file mode 100644 index 00000000..fbe41f76 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/misc/SignalIndustriesAchievementPage.java @@ -0,0 +1,63 @@ +package sunsetsatellite.signalindustries.misc; + +import net.minecraft.client.render.TextureFX; +import net.minecraft.core.Global; +import net.minecraft.core.achievement.Achievement; +import net.minecraft.core.achievement.AchievementList; +import net.minecraft.core.block.Block; +import net.minecraft.core.util.helper.Side; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.signalindustries.SignalIndustries; +import turniplabs.halplibe.util.achievements.AchievementPage; +import turniplabs.halplibe.util.achievements.GuiAchievements; + +import java.util.Random; + +public class SignalIndustriesAchievementPage extends AchievementPage { + public SignalIndustriesAchievementPage() { + super("Signal Industries", "achievements.page.signalindustries"); + achievementList.add((Achievement) INIT.registerStat()); + achievementList.add((Achievement) THE_PROTOTYPE.registerStat()); + achievementList.add((Achievement) FROM_WITHIN.registerStat()); + } + + public static final Achievement INIT = new Achievement(AchievementList.achievementList.size()+1,SignalIndustries.key("init"),0,0,SignalIndustries.rawSignalumCrystal,null); + public static final Achievement THE_PROTOTYPE = new Achievement(AchievementList.achievementList.size()+2,SignalIndustries.key("thePrototype"),2,0,SignalIndustries.prototypeMachineCore,INIT); + public static final Achievement FROM_WITHIN = new Achievement(AchievementList.achievementList.size()+3,SignalIndustries.key("fromWithin"),4,0,SignalIndustries.prototypeExtractor,THE_PROTOTYPE); + + @Override + public void getBackground(GuiAchievements guiAchievements, Random random, int iOffset, int jOffset, int blockX1, int blockY1, int blockX2, int blockY2) { + for(int l7 = 0; l7 * 16 - blockY2 < 155; ++l7) { + float f5 = 0.6F - (float)(blockY1 + l7) / 25.0F * 0.3F; + GL11.glColor4f(f5, f5, f5, 1.0F); + + for(int i8 = 0; i8 * 16 - blockX2 < 224; ++i8) { + random.setSeed((long)(1234 + blockX1 + i8)); + random.nextInt(); + int j8 = random.nextInt(1 + blockY1 + l7) + (blockY1 + l7) / 2; + int k8 = Block.sand.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + if (j8 <= 37 && blockY1 + l7 != 35) { + if (j8 == 22) { + k8 = SignalIndustries.dilithiumOre.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } else if (j8 == 10) { + k8 = Block.oreIronBasalt.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } else if (j8 == 8) { + k8 = SignalIndustries.signalumOre.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } else if (j8 > 4) { + k8 = Block.basalt.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } else if (j8 > 0) { + k8 = Block.stone.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } + } else { + if (random.nextInt(2) == 0) { + k8 = SignalIndustries.dimensionalShardOre.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } else { + k8 = SignalIndustries.realityFabric.getBlockTextureFromSideAndMetadata(Side.BOTTOM, 0); + } + } + + guiAchievements.drawTexturedModalRect(iOffset + i8 * 16 - blockX2, jOffset + l7 * 16 - blockY2, k8 % Global.TEXTURE_ATLAS_WIDTH_TILES * TextureFX.tileWidthTerrain, k8 / Global.TEXTURE_ATLAS_WIDTH_TILES * TextureFX.tileWidthTerrain, 16, 16, TextureFX.tileWidthTerrain, 1.0F / (float)(Global.TEXTURE_ATLAS_WIDTH_TILES * TextureFX.tileWidthTerrain)); + } + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java new file mode 100644 index 00000000..46c3f1c4 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/AchievementMixin.java @@ -0,0 +1,28 @@ +package sunsetsatellite.signalindustries.mixin; + +import net.minecraft.core.achievement.Achievement; +import net.minecraft.core.achievement.stat.StatBase; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin( + value = Achievement.class, + remap = false +) +public abstract class AchievementMixin extends StatBase { + + public AchievementMixin(int i, String s) { + super(i, s); + } + + @Inject( + method = "registerStat", at = @At("HEAD"), + cancellable = true + ) + public void registerStat(CallbackInfoReturnable cir) { + super.registerStat(); + cir.setReturnValue((Achievement)((Object)this)); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/ChunkDecoratorOverworldMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/ChunkDecoratorOverworldMixin.java index 98ea6e87..4130239c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/ChunkDecoratorOverworldMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/ChunkDecoratorOverworldMixin.java @@ -1,7 +1,5 @@ package sunsetsatellite.signalindustries.mixin; -//TODO: Remake world gen - import net.minecraft.core.block.Block; import net.minecraft.core.world.World; import net.minecraft.core.world.biome.Biome; @@ -17,6 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.worldgen.WorldFeatureMeteor; +import sunsetsatellite.signalindustries.worldgen.WorldFeatureObelisk; import java.util.Random; @@ -47,5 +46,10 @@ public void decorate(Chunk chunk, CallbackInfo ci, int chunkX, int chunkZ, int m y = this.world.getHeightValue(x,z) - 4; new WorldFeatureMeteor(SignalIndustries.dilithiumOre.id,0,3).generate(world,rand,x,y,z); } + if(rand.nextInt(4096) == 0){ + SignalIndustries.LOGGER.info(String.format("Obelisk at X:%d Z:%d (X:%d Y:%d Z:%d)",chunkX,chunkZ,x,y,z)); + y = this.world.getHeightValue(x,z); + new WorldFeatureObelisk().generate(world,rand,x,y,z); + } } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java new file mode 100644 index 00000000..e0689899 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityArrowMixin.java @@ -0,0 +1,31 @@ +package sunsetsatellite.signalindustries.mixin; + +import net.minecraft.core.entity.EntityLiving; +import net.minecraft.core.entity.monster.EntityMonster; +import net.minecraft.core.entity.projectile.EntityArrow; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import sunsetsatellite.signalindustries.SignalIndustries; + +@Mixin( + value = EntityArrow.class, + remap = false +) +public class EntityArrowMixin { + + @Shadow public EntityLiving owner; + + @Shadow protected int arrowDamage; + + @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.currentWeather == SignalIndustries.weatherBloodMoon && owner instanceof EntityMonster){ + arrowDamage *= 2; + } + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/GameSettingsMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/GameSettingsMixin.java index 8b5c8b75..7137aac8 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/GameSettingsMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/GameSettingsMixin.java @@ -20,6 +20,9 @@ public class GameSettingsMixin @Unique public KeyBinding keyActivateAbility = new KeyBinding("key.signalindustries.activateAbility",54); + @Unique + public KeyBinding keySwitchMode = new KeyBinding("key.signalindustries.switchMode",50); + @Override public KeyBinding signalIndustries$getKeyOpenSuit() { return keyOpenSuit; @@ -29,4 +32,9 @@ public class GameSettingsMixin public KeyBinding signalIndustries$getKeyActivateAbility() { return keyActivateAbility; } + + @Override + public KeyBinding signalIndustries$getKeySwitchMode() { + return keySwitchMode; + } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/MinecraftMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/MinecraftMixin.java index b2517fcc..977a8981 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/MinecraftMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/MinecraftMixin.java @@ -2,6 +2,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.EntityPlayerSP; +import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.option.GameSettings; import net.minecraft.client.option.KeyBinding; @@ -9,11 +10,14 @@ import org.lwjgl.input.Keyboard; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.interfaces.mixins.IKeybinds; import sunsetsatellite.signalindustries.interfaces.mixins.IPlayerPowerSuit; +import sunsetsatellite.signalindustries.items.ItemSignalumDrill; import sunsetsatellite.signalindustries.powersuit.SignalumPowerSuit; import java.util.Objects; @@ -33,35 +37,63 @@ public class MinecraftMixin { @Shadow public HitResult objectMouseOver; + @Shadow public GuiIngame ingameGUI; + @Unique + private static int debounce = 0; + @Inject( method = "runTick", at = @At(value = "INVOKE",target = "Lorg/lwjgl/input/Keyboard;next()Z",shift = At.Shift.AFTER) ) public void handleKeyboard(CallbackInfo ci){ + if(debounce > 0) debounce--; boolean shift = (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); boolean control = (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)); KeyBinding openSuitKey = ((IKeybinds) Minecraft.getMinecraft(Minecraft.class).gameSettings).signalIndustries$getKeyOpenSuit(); KeyBinding activeAbilityKey = ((IKeybinds) Minecraft.getMinecraft(Minecraft.class).gameSettings).signalIndustries$getKeyActivateAbility(); + KeyBinding switchModeKey = ((IKeybinds) Minecraft.getMinecraft(Minecraft.class).gameSettings).signalIndustries$getKeySwitchMode(); SignalumPowerSuit powerSuit = ((IPlayerPowerSuit)thePlayer).signalIndustries$getPowerSuit(); - if(openSuitKey.isPressed()){ - if(currentScreen == null && powerSuit != null){ - if(shift){ - powerSuit.active = !powerSuit.active; - return; + if(debounce <= 0){ + if(switchModeKey.isPressed()){ + debounce = 10; + if(thePlayer != null){ + if(thePlayer.getCurrentEquippedItem().getItem() == SignalIndustries.reinforcedSignalumDrill){ + ItemSignalumDrill.DrillMode mode = ((ItemSignalumDrill)SignalIndustries.reinforcedSignalumDrill).getMode(thePlayer.getCurrentEquippedItem()); + switch (mode){ + case NORMAL: + ((ItemSignalumDrill)SignalIndustries.reinforcedSignalumDrill).setMode(thePlayer.getCurrentEquippedItem(), ItemSignalumDrill.DrillMode.X3); + break; + case X3: + ((ItemSignalumDrill)SignalIndustries.reinforcedSignalumDrill).setMode(thePlayer.getCurrentEquippedItem(), ItemSignalumDrill.DrillMode.NORMAL); + break; + } + mode = ((ItemSignalumDrill)SignalIndustries.reinforcedSignalumDrill).getMode(thePlayer.getCurrentEquippedItem()); + ingameGUI.addChatMessage("Mode switched to: "+mode); + } } - powerSuit.openCoreUi(); } - } - if(activeAbilityKey.isPressed()){ - if(currentScreen == null && powerSuit != null && powerSuit.active) { - if (objectMouseOver != null && objectMouseOver.entity == null) { - powerSuit.activateSelectedAbility(objectMouseOver.x, objectMouseOver.y, objectMouseOver.z); - } else if (objectMouseOver != null) { - powerSuit.activateSelectedAbility(objectMouseOver.entity); - } else { - powerSuit.activateSelectedAbility(); + if(openSuitKey.isPressed()){ + debounce = 10; + if(currentScreen == null && powerSuit != null){ + if(shift){ + powerSuit.active = !powerSuit.active; + return; + } + powerSuit.openCoreUi(); } + } + if(activeAbilityKey.isPressed()){ + debounce = 10; + if(currentScreen == null && powerSuit != null && powerSuit.active) { + if (objectMouseOver != null && objectMouseOver.entity == null) { + powerSuit.activateSelectedAbility(objectMouseOver.x, objectMouseOver.y, objectMouseOver.z); + } else if (objectMouseOver != null) { + powerSuit.activateSelectedAbility(objectMouseOver.entity); + } else { + powerSuit.activateSelectedAbility(); + } + } } } for(int i = 1; i < 10; ++i) { diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderBlocksMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderBlocksMixin.java index 0c164a35..6334119c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderBlocksMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderBlocksMixin.java @@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidPipe; -import sunsetsatellite.signalindustries.util.RenderConduit; +import sunsetsatellite.signalindustries.render.RenderConduit; @Mixin( value={RenderBlocks.class}, diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java index 53777a62..6e9a866e 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderGlobalMixin.java @@ -1,10 +1,12 @@ package sunsetsatellite.signalindustries.mixin; import net.minecraft.client.Minecraft; +import net.minecraft.client.render.Lighting; import net.minecraft.client.render.RenderEngine; import net.minecraft.client.render.RenderGlobal; import net.minecraft.client.render.Tessellator; import net.minecraft.core.entity.fx.EntitySlimeFX; +import net.minecraft.core.util.helper.MathHelper; import net.minecraft.core.util.phys.Vec3d; import net.minecraft.core.world.World; import org.lwjgl.opengl.GL11; @@ -124,4 +126,115 @@ public void renderClouds(float f, CallbackInfo ci) { ci.cancel(); } } + + @Inject( + method = "drawSky", + at = @At("HEAD"), + cancellable = true + ) + public void eternitySky(float renderPartialTicks, CallbackInfo ci){ + if(this.mc.theWorld.dimension == SignalIndustries.dimEternity){ + float celestialAngle = this.worldObj.getCelestialAngle(renderPartialTicks); + GL11.glDisable(3553); + Vec3d vec3d = this.worldObj.getSkyColor(this.mc.activeCamera, renderPartialTicks); + float f1 = (float)vec3d.xCoord; + float f2 = (float)vec3d.yCoord; + float f3 = (float)vec3d.zCoord; + GL11.glColor3f(f1, f2, f3); + Tessellator tessellator = Tessellator.instance; + GL11.glDepthMask(false); + GL11.glEnable(2912); + GL11.glColor3f(f1, f2, f3); + GL11.glCallList(this.glSkyList); + GL11.glDisable(2912); + GL11.glDisable(3008); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + Lighting.enableLight(); + float[] af = this.worldObj.worldType.getSunriseColor(celestialAngle, renderPartialTicks); + float f6; + float f9; + float f11; + float f20; + if (af != null) { + GL11.glDisable(3553); + GL11.glShadeModel(7425); + GL11.glPushMatrix(); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(celestialAngle <= 0.5F ? 0.0F : 180.0F, 0.0F, 0.0F, 1.0F); + f6 = af[0]; + f9 = af[1]; + f11 = af[2]; + tessellator.startDrawing(6); + tessellator.setColorRGBA_F(f6, f9, f11, af[3]); + tessellator.addVertex(0.0, 100.0, 0.0); + int i = 16; + tessellator.setColorRGBA_F(af[0], af[1], af[2], 0.0F); + + for(int j = 0; j <= i; ++j) { + f20 = (float)j * 3.141593F * 2.0F / (float)i; + float f21 = MathHelper.sin(f20); + float f22 = MathHelper.cos(f20); + tessellator.addVertex(f21 * 120.0F, f22 * 120.0F, -f22 * 40.0F * af[3]); + } + + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glShadeModel(7424); + } + + GL11.glEnable(3553); + GL11.glBlendFunc(770, 1); + GL11.glPushMatrix(); + f6 = 1.0F; //- (this.worldObj.currentWeather != null && this.worldObj.currentWeather != Weather.overworldClear ? this.worldObj.weatherIntensity * this.worldObj.weatherPower * 1.5F : 0.0F); + f9 = 0.0F; + f11 = 0.0F; + float f13 = 0.0F; + GL11.glTranslatef(f9, f11, f13); + GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(celestialAngle * 360.0F, 0.0F, 0.0F, 1.0F); + float f15 = 30.0F; + //GL11.glBindTexture(3553, this.renderEngine.getTexture("/terrain/sun.png")); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f6); + /*tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-f15, 100.0, -f15, 0.0, 0.0); + tessellator.addVertexWithUV(f15, 100.0, -f15, 1.0, 0.0); + tessellator.addVertexWithUV(f15, 100.0, f15, 1.0, 1.0); + tessellator.addVertexWithUV(-f15, 100.0, f15, 0.0, 1.0); + tessellator.draw();*/ + f15 = 20.0F; + //GL11.glBindTexture(3553, this.renderEngine.getTexture("/terrain/moon.png")); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f6); + /*tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-f15, -100.0, f15, 1.0, 1.0); + tessellator.addVertexWithUV(f15, -100.0, f15, 0.0, 1.0); + tessellator.addVertexWithUV(f15, -100.0, -f15, 0.0, 0.0); + tessellator.addVertexWithUV(-f15, -100.0, -f15, 1.0, 0.0); + tessellator.draw();*/ + GL11.glDisable(3553); + f20 = this.worldObj.getStarBrightness(renderPartialTicks) * f6; + if (f20 > 0.0F) { + GL11.glColor4f(f20, f20, f20, f20); + GL11.glCallList(this.starGLCallList); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3042); + GL11.glEnable(3008); + GL11.glEnable(2912); + GL11.glPopMatrix(); + if (this.worldObj.worldType.hasGround()) { + GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F); + } else { + GL11.glColor3f(f1, f2, f3); + } + + GL11.glDisable(3553); + GL11.glCallList(this.glSkyList2); + GL11.glEnable(3553); + GL11.glDepthMask(true); + ci.cancel(); + } + } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java index 5327fb40..49d6928c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/RenderPlayerMixin.java @@ -75,7 +75,7 @@ protected void renderSpecials(EntityPlayer entityplayer, float f, CallbackInfo c if(stack.getItem() instanceof ItemPulsar){ GL11.glRotatef(160f, 0.0F, -1.2F, 1.55F); GL11.glTranslatef(-0.15F, 0.15f, 0.25F); - if(stack.tag.getByte("charge") >= 100){ + if(stack.getData().getByte("charge") >= 100){ } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java index c27ca665..ce0930fc 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java @@ -9,6 +9,7 @@ import net.minecraft.core.entity.player.EntityPlayer; import net.minecraft.core.net.command.TextFormatting; import net.minecraft.core.util.phys.Vec3d; +import net.minecraft.core.world.Dimension; import net.minecraft.core.world.Explosion; import net.minecraft.core.world.World; import net.minecraft.core.world.season.SeasonManager; @@ -58,6 +59,8 @@ public abstract class WorldMixin { @Shadow @Final public SeasonManager seasonManager; + @Shadow @Final public Dimension dimension; + @Inject( method = "getSkyColor", at = @At("HEAD"), @@ -68,6 +71,9 @@ public void getSkyColor(ICamera camera, float renderPartialTicks, CallbackInfoRe } else if (currentWeather == SignalIndustries.weatherSolarApocalypse) { cir.setReturnValue(Vec3d.createVector(1.0, 0.5, 0)); } + if(dimension == SignalIndustries.dimEternity){ + cir.setReturnValue(Vec3d.createVector(0.35,0.35,0.35)); + } } @Inject( @@ -94,7 +100,7 @@ public void doBloodMoon(CallbackInfo ci){ currentWeather = Weather.overworldClear; } if(currentWeather == SignalIndustries.weatherBloodMoon){ - ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/assets/signalindustries/misc/bloodmooncolorizer.png")); + ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/assets/signalindustries/misc/blood_moon_colorizer.png")); } else { ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/misc/watercolor.png")); } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/accessors/GuiBlockOverlayAccessor.java b/src/main/java/sunsetsatellite/signalindustries/mixin/accessors/GuiBlockOverlayAccessor.java deleted file mode 100644 index 075af225..00000000 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/accessors/GuiBlockOverlayAccessor.java +++ /dev/null @@ -1,18 +0,0 @@ -package sunsetsatellite.signalindustries.mixin.accessors; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; -import toufoumaster.btwaila.gui.GuiBlockOverlay; - -@Mixin( - value = GuiBlockOverlay.class, - remap = false -) -public interface GuiBlockOverlayAccessor { - - @Accessor - int getPosX(); - - @Accessor - int getOffY(); -} diff --git a/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java b/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java index 414547cd..3a8d49e0 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java +++ b/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java @@ -21,9 +21,6 @@ public class PacketOpenMachineGUI extends Packet { public int blockZ; public ItemStack stack; - public PacketOpenMachineGUI() { - } - public PacketOpenMachineGUI(int windowId, String windowTitle, int slotsCount, int x, int y, int z) { this.windowId = windowId; this.windowTitle = windowTitle; @@ -75,7 +72,7 @@ public void writePacketData(DataOutputStream dataoutputstream) throws IOExceptio dataoutputstream.writeShort(this.stack.itemID); dataoutputstream.writeByte(this.stack.stackSize); dataoutputstream.writeShort(this.stack.getMetadata()); - writeCompressedCompoundTag(this.stack.tag, dataoutputstream); + writeCompressedCompoundTag(this.stack.getData(), dataoutputstream); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/render/RenderAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderAutoMiner.java new file mode 100644 index 00000000..93fa5ac4 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderAutoMiner.java @@ -0,0 +1,336 @@ +package sunsetsatellite.signalindustries.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.render.RenderEngine; +import net.minecraft.client.render.tileentity.TileEntityRenderer; +import net.minecraft.core.block.Block; +import net.minecraft.core.block.entity.TileEntity; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.fluidapi.render.RenderFluid; +import sunsetsatellite.signalindustries.SignalIndustries; +import sunsetsatellite.signalindustries.inventories.TileEntityAutoMiner; + +import java.util.ArrayList; + +public class RenderAutoMiner extends TileEntityRenderer { + + private final RenderFluid blockRenderer = new RenderFluid(); + + public void drawBlock(RenderEngine renderengine, int i, int j, TileEntity tile) { + renderengine.bindTexture(renderengine.getTexture("/terrain.png")); + Block f1 = Block.blocksList[i]; + GL11.glPushMatrix(); + this.blockRenderer.renderBlock(f1, j, renderengine.minecraft.theWorld, tile.xCoord, tile.yCoord, tile.zCoord); + GL11.glPopMatrix(); + GL11.glEnable(2884); + } + @Override + public void doRender(TileEntityAutoMiner tileEntity, double x, double y, double z, float f) { + int tx = tileEntity.xCoord; + int ty = tileEntity.yCoord; + int tz = tileEntity.zCoord; + int cx = tileEntity.current.x; + int cy = tileEntity.current.y; + int cz = tileEntity.current.z; + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x-(tx-cx)+0.25f, (float)y+4.25f, (float)z+(cz-tz)+0.25f); + GL11.glScalef(0.5f,0.5f,0.5f); + GL11.glDisable(2896); + this.drawBlock(renderDispatcher.renderEngine, SignalIndustries.basicMachineCore.id,0, tileEntity); + GL11.glEnable(2896); + GL11.glPopMatrix(); + + if(cy-(ty+4) < 0){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)x-(tx-cx)+0.25f, (float)y-(ty-cy)+0.5f, (float)z+(cz-tz)+0.25f); + GL11.glScalef(0.50f,1f,0.50f); + GL11.glDisable(2896); + this.drawBlock(renderDispatcher.renderEngine,Block.basalt.id,0, tileEntity); + GL11.glEnable(2896); + GL11.glPopMatrix(); + } + + if(cy-(ty+4) <= 0){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)x-(tx-cx)+0.375f, (float)y-(ty-cy), (float)z+(cz-tz)+0.375f); + GL11.glScalef(0.25f,0.75f,0.25f); + GL11.glDisable(2896); + this.drawBlock(renderDispatcher.renderEngine,Block.blockDiamond.id,0, tileEntity); + GL11.glEnable(2896); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glTranslatef((float)x-(tx-cx)+0.375f, (float)y-(ty-cy)+1f, (float)z+(cz-tz)+0.375f); + GL11.glScalef(0.25f,0.75f,0.25f); + GL11.glDisable(2896); + this.drawBlock(renderDispatcher.renderEngine,Block.blockDiamond.id,0, tileEntity); + GL11.glEnable(2896); + GL11.glPopMatrix(); + } + + + + + + //square above + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,0.5f,0,1,8,x,y+4,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,0.5f,0,1,8,x,y+4,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,0.5f,0,1,8,x,y+4,z+17); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,0.5f,0,1,8,x-17,y+4,z); + //square + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,0.5f,0,1,8,x,y,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,0.5f,0,1,8,x,y,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,0.5f,0,1,8,x,y,z+17); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,0.5f,0,1,8,x-17,y,z); + //down + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty-4,tz,1,0.5f,0,1,8,x,y+4,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty-4,tz,1,0.5f,0,1,8,x-17,y+4,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty-4,tz,1,0.5f,0,1,8,x,y+4,z+17); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty-4,tz,1,0.5f,0,1,8,x-17,y+4,z+17); + //down 2 + renderLineBetweenTwoPoints(tx,ty,tz,tx,0,tz,1,1,1,1,2,x,y,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,0,tz,1,1,1,1,2,x-17,y,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,0,tz,1,1,1,1,2,x,y,z+17); + renderLineBetweenTwoPoints(tx,ty,tz,tx,0,tz,1,1,1,1,2,x-17,y,z+17); + //square down + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,1,1,1,2,x,y-ty,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,1,1,1,2,x,y-ty,z); + renderLineBetweenTwoPoints(tx,ty,tz,tx-17,ty,tz,1,1,1,1,2,x,y-ty,z+17); + renderLineBetweenTwoPoints(tx,ty,tz,tx,ty,tz+17,1,1,1,1,2,x-17,y-ty,z); + + //current lines + renderLineBetweenTwoPoints(tx,ty,tz,cx,ty,tz,1,0,0,1,8,x,y+4,z+(cz-tz)); + renderLineBetweenTwoPoints(tx,ty,cz,tx,ty,tz,0,0,1,1,8,x-(tx-cx),y+4,z+(cz-tz)); + renderLineBetweenTwoPoints(tx,ty,tz,tx,cy-3,tz,0,1,0,1,8,x-(tx-cx),y+4,z+(cz-tz)); + } + + public void renderLineBetweenTwoPoints(int x1, int y1, int z1, long x2, long y2, long z2, float red, float green, float blue, float alpha, float width, double x, double y, double z) { + renderLineBetweenTwoPoints(x1,y1,z1,x2,y2,z2,red,green,blue,alpha,width,new ArrayList<>(),new ArrayList<>(),new ArrayList<>(),new ArrayList<>(),false,false,false,x,y,z); + } + + public void renderLineBetweenTwoPoints(int x1, int y1, int z1, long x2, long y2, long z2, float red, float green, float blue, float alpha, float width, ArrayList xadd, ArrayList yadd, ArrayList zadd, ArrayList sideadd, boolean backwired, boolean firstblocksided, boolean secondblocksided, double x, double y, double z){ + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(red, green, blue, alpha); + GL11.glLineWidth(width); + GL11.glTranslated(x, y, z); + GL11.glDepthMask(false); + GL11.glBegin(GL11.GL_LINE_STRIP); + //First + if(!backwired) { + if(firstblocksided){ + float xoffset = 0; + float yoffset = 0; + float zoffset = 0; + switch(Minecraft.getMinecraft(Minecraft.class).theWorld.getBlockMetadata(x1, y1, z1)){ + case 0: + xoffset = 0.5f; + yoffset = 0.9f; + zoffset = 0.5f; + break; + case 1: + xoffset = 0.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 2: + xoffset = 0.9f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 3: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.1f; + break; + case 4: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.9f; + break; + case 5: + xoffset = 0.5f; + yoffset = 0.1f; + zoffset = 0.5f; + break; + } + GL11.glVertex3f(xoffset, yoffset, zoffset); + } else { + GL11.glVertex3f(0.5f, 0.5f, 0.5f); + } + } else{ + if(secondblocksided) { + float xoffset = 0; + float yoffset = 0; + float zoffset = 0; + switch (Minecraft.getMinecraft(Minecraft.class).theWorld.getBlockMetadata((int) x2, (int) y2, (int) z2)) { + case 0: + xoffset = 0.5f; + yoffset = 0.9f; + zoffset = 0.5f; + break; + case 1: + xoffset = 0.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 2: + xoffset = 0.9f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 3: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.1f; + break; + case 4: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.9f; + break; + case 5: + xoffset = 0.5f; + yoffset = 0.1f; + zoffset = 0.5f; + break; + } + GL11.glVertex3d(-(x1 - x2) + xoffset,-(y1 - y2) + yoffset, -(z1 - z2) + zoffset); + } else { + GL11.glVertex3d(-(x1 - x2) + 0.5f, -(y1 - y2) + 0.5f, -(z1 - z2) + 0.5f); + } + } + //Middle + for(int i = xadd.size() - 1; i >= 0 ; i--){ + float xoffset = 0; + float yoffset = 0; + float zoffset = 0; + switch(sideadd.get(i)){ + case 0: + xoffset = 0.5f; + yoffset = -0.1f; + zoffset = 0.5f; + break; + case 1: + xoffset = 0.5f; + yoffset = 1.1f; + zoffset = 0.5f; + break; + case 2: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = -0.1f; + break; + case 3: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 1.1f; + break; + case 4: + xoffset = -0.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 5: + xoffset = 1.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + } + GL11.glVertex3d(-(x1 - xadd.get(i)) + xoffset, -(y1 - yadd.get(i)) + yoffset, -(z1 - zadd.get(i)) + zoffset); + } + //Second + if(backwired) { + if(firstblocksided){ + float xoffset = 0; + float yoffset = 0; + float zoffset = 0; + switch(Minecraft.getMinecraft(Minecraft.class).theWorld.getBlockMetadata(x1, y1, z1)){ + case 0: + xoffset = 0.5f; + yoffset = 0.9f; + zoffset = 0.5f; + break; + case 1: + xoffset = 0.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 2: + xoffset = 0.9f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 3: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.1f; + break; + case 4: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.9f; + break; + case 5: + xoffset = 0.5f; + yoffset = 0.1f; + zoffset = 0.5f; + break; + } + GL11.glVertex3f(xoffset, yoffset, zoffset); + } else { + GL11.glVertex3f(0.5f, 0.5f, 0.5f); + } + } else{ + if(secondblocksided) { + float xoffset = 0; + float yoffset = 0; + float zoffset = 0; + switch (Minecraft.getMinecraft(Minecraft.class).theWorld.getBlockMetadata((int) x2, (int) y2, (int) z2)) { + case 0: + xoffset = 0.5f; + yoffset = 0.9f; + zoffset = 0.5f; + break; + case 1: + xoffset = 0.1f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 2: + xoffset = 0.9f; + yoffset = 0.5f; + zoffset = 0.5f; + break; + case 3: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.1f; + break; + case 4: + xoffset = 0.5f; + yoffset = 0.5f; + zoffset = 0.9f; + break; + case 5: + xoffset = 0.5f; + yoffset = 0.1f; + zoffset = 0.5f; + break; + } + GL11.glVertex3d(-(x1 - x2) + xoffset, -(y1 - y2) + yoffset, -(z1 - z2) + zoffset); + } else { + GL11.glVertex3d(-(x1 - x2) + 0.5f, -(y1 - y2) + 0.5f, -(z1 - z2) + 0.5f); + } + } + GL11.glEnd(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/util/RenderConduit.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderConduit.java similarity index 98% rename from src/main/java/sunsetsatellite/signalindustries/util/RenderConduit.java rename to src/main/java/sunsetsatellite/signalindustries/render/RenderConduit.java index 607eeb50..2b7dbd02 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/RenderConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderConduit.java @@ -1,4 +1,4 @@ -package sunsetsatellite.signalindustries.util; +package sunsetsatellite.signalindustries.render; import net.minecraft.client.render.RenderBlocks; diff --git a/src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInBlock.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInBlock.java new file mode 100644 index 00000000..4b65adcf --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInBlock.java @@ -0,0 +1,58 @@ +package sunsetsatellite.signalindustries.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.render.FontRenderer; +import net.minecraft.client.render.RenderEngine; +import net.minecraft.client.render.tileentity.TileEntityRenderer; +import net.minecraft.core.block.Block; +import net.minecraft.core.block.entity.TileEntity; +import org.lwjgl.opengl.GL11; +import sunsetsatellite.fluidapi.render.RenderFluid; +import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidContainer; + +public class RenderFluidInBlock extends TileEntityRenderer { + private final RenderFluid blockRenderer = new RenderFluid(); + + public RenderFluidInBlock() { + } + + public void doRender(TileEntity tileEntity1, double d2, double d4, double d6, float f8) { + float fluidAmount = 0.0F; + float fluidMaxAmount = 1.0F; + int fluidId = 0; + if (Minecraft.getMinecraft(Minecraft.class).theWorld.isClientSide) { + if (((TileEntityFluidContainer)tileEntity1).shownFluid != null) { + fluidId = ((TileEntityFluidContainer)tileEntity1).shownFluid.getLiquid().id; + fluidAmount = (float)((TileEntityFluidContainer)tileEntity1).shownFluid.amount; + fluidMaxAmount = (float)((TileEntityFluidContainer)tileEntity1).shownMaxAmount; + } + } else if (((TileEntityFluidContainer)tileEntity1).fluidContents[0] != null && ((TileEntityFluidContainer)tileEntity1).fluidContents[0].getLiquid() != null) { + fluidMaxAmount = (float)((TileEntityFluidContainer)tileEntity1).getFluidCapacityForSlot(0); + fluidAmount = (float)((TileEntityFluidContainer)tileEntity1).fluidContents[0].amount; + fluidId = ((TileEntityFluidContainer)tileEntity1).fluidContents[0].getLiquid().id; + } + + float amount = Math.abs(fluidAmount / fluidMaxAmount - 0.02F); + if (fluidId != 0) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d2, (float)d4, (float)d6); + GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.98F, amount, 0.98F); + GL11.glTranslatef(0.01F, 0.01F, 0.01F); + GL11.glDisable(2896); + this.drawBlock(this.getFontRenderer(), this.renderDispatcher.renderEngine.minecraft.renderEngine, fluidId, 0, 0, 0, 0, tileEntity1); + GL11.glEnable(2896); + GL11.glPopMatrix(); + } + + } + + public void drawBlock(FontRenderer fontrenderer, RenderEngine renderengine, int i, int j, int k, int l, int i1, TileEntity tile) { + renderengine.bindTexture(renderengine.getTexture("/terrain.png")); + Block f1 = Block.blocksList[i]; + GL11.glPushMatrix(); + this.blockRenderer.renderBlock(f1, j, renderengine.minecraft.theWorld, tile.xCoord, tile.yCoord, tile.zCoord); + GL11.glPopMatrix(); + GL11.glEnable(2884); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/util/RenderFluidInConduit.java b/src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInConduit.java similarity index 98% rename from src/main/java/sunsetsatellite/signalindustries/util/RenderFluidInConduit.java rename to src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInConduit.java index b652f7ce..c5d49e35 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/RenderFluidInConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/render/RenderFluidInConduit.java @@ -1,4 +1,4 @@ -package sunsetsatellite.signalindustries.util; +package sunsetsatellite.signalindustries.render; import net.minecraft.client.Minecraft; import net.minecraft.client.render.FontRenderer; @@ -47,6 +47,8 @@ public void doRender(TileEntity tileEntity1, double d2, double d4, double d6, fl } } + fluidAmount = Math.min(fluidAmount,fluidMaxAmount); + boolean flag = blockAccess.getBlockId(i + 1, j, k) == block.id || (blockAccess.getBlockTileEntity(i + 1, j, k) instanceof IFluidInventory); boolean flag1 = blockAccess.getBlockId(i - 1, j, k) == block.id || (blockAccess.getBlockTileEntity(i - 1, j, k) instanceof IFluidInventory); boolean flag2 = blockAccess.getBlockId(i, j + 1, k) == block.id || (blockAccess.getBlockTileEntity(i, j + 1, k) instanceof IFluidInventory); diff --git a/src/main/java/sunsetsatellite/signalindustries/util/BlockTexture.java b/src/main/java/sunsetsatellite/signalindustries/util/BlockTexture.java new file mode 100644 index 00000000..f02b5969 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/util/BlockTexture.java @@ -0,0 +1,118 @@ +package sunsetsatellite.signalindustries.util; + +import net.minecraft.core.block.Block; +import net.minecraft.core.util.helper.Side; +import sunsetsatellite.sunsetutils.util.Direction; +import turniplabs.halplibe.helper.TextureHelper; + +public class BlockTexture { + private int[] topTexture; + private int[] bottomTexture; + private int[] northTexture; + private int[] eastTexture; + private int[] southTexture; + private int[] westTexture; + private String modId; + + public BlockTexture(String modId){ + this.modId = modId; + } + + public BlockTexture setAll(String texture){ + this.topTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.bottomTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.northTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.eastTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.southTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.westTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setSides(String texture){ + this.northTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.eastTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.southTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.westTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setTopAndBottom(String texture){ + this.topTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + this.bottomTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setTopTexture(String texture) { + this.topTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setBottomTexture(String texture) { + this.bottomTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setNorthTexture(String texture) { + this.northTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setEastTexture(String texture) { + this.eastTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setSouthTexture(String texture) { + this.southTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setWestTexture(String texture) { + this.westTexture = TextureHelper.getOrCreateBlockTexture(modId,texture); + return this; + } + + public BlockTexture setTexture(Direction dir, String texture){ + switch (dir){ + case X_POS: + setEastTexture(texture); + break; + case X_NEG: + setWestTexture(texture); + break; + case Y_POS: + setTopTexture(texture); + break; + case Y_NEG: + setBottomTexture(texture); + break; + case Z_POS: + setSouthTexture(texture); + break; + case Z_NEG: + setNorthTexture(texture); + break; + } + return this; + } + + public int getTexture(Side side){ + switch (side){ + case TOP: + return Block.texCoordToIndex(topTexture[0],topTexture[1]); + case BOTTOM: + return Block.texCoordToIndex(bottomTexture[0],bottomTexture[1]); + case NORTH: + return Block.texCoordToIndex(northTexture[0],northTexture[1]); + case EAST: + return Block.texCoordToIndex(eastTexture[0],eastTexture[1]); + case SOUTH: + return Block.texCoordToIndex(southTexture[0],southTexture[1]); + case WEST: + return Block.texCoordToIndex(westTexture[0],westTexture[1]); + case NONE: + return 0; + } + return 0; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java b/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java index 76f523fa..207b0031 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java +++ b/src/main/java/sunsetsatellite/signalindustries/util/NBTHelper.java @@ -11,7 +11,7 @@ public class NBTHelper { public static void saveInvToNBT(ItemStack source_item, IInventory inv){ - CompoundTag itemData = source_item.tag.getCompound("inventory"); + CompoundTag itemData = source_item.getData().getCompound("inventory"); for(int i = 0; i < inv.getSizeInventory();i++){ ItemStack item = inv.getStackInSlot(i); CompoundTag itemNBT = new CompoundTag(); @@ -22,10 +22,10 @@ public static void saveInvToNBT(ItemStack source_item, IInventory inv){ ((INBTCompound)itemData).removeTag(String.valueOf(i)); } } - source_item.tag.putCompound("inventory",itemData); + source_item.getData().putCompound("inventory",itemData); if(inv instanceof IFluidInventory){ IFluidInventory fluidInv = (IFluidInventory) inv; - CompoundTag fluidData = source_item.tag.getCompound("fluidInventory"); + CompoundTag fluidData = source_item.getData().getCompound("fluidInventory"); for(int i = 0; i < fluidInv.getFluidInventorySize();i++){ FluidStack fluid = ((IFluidInventory) inv).getFluidInSlot(i); CompoundTag fluidNBT = new CompoundTag(); @@ -36,7 +36,7 @@ public static void saveInvToNBT(ItemStack source_item, IInventory inv){ ((INBTCompound)fluidData).removeTag(String.valueOf(i)); } } - source_item.tag.putCompound("fluidInventory",fluidData); + source_item.getData().putCompound("fluidInventory",fluidData); } } @@ -58,8 +58,8 @@ public static void saveInvToNBT(ItemStack source_item, IInventory inv){ }*/ public static void loadInvFromNBT(ItemStack source_item, IInventory inv, int amount, int fluidAmount){ - CompoundTag itemNBT = source_item.tag.getCompound("inventory"); - CompoundTag fluidNBT = source_item.tag.getCompound("fluidInventory"); + CompoundTag itemNBT = source_item.getData().getCompound("inventory"); + CompoundTag fluidNBT = source_item.getData().getCompound("fluidInventory"); for(int i = 0; i < amount;i++){ if(itemNBT.containsKey(String.valueOf(i))){ ItemStack item = ItemStack.readItemStackFromNbt(itemNBT.getCompound(String.valueOf(i))); diff --git a/src/main/java/sunsetsatellite/signalindustries/util/NumberUtil.java b/src/main/java/sunsetsatellite/signalindustries/util/NumberUtil.java index 75fb448d..5cd108f5 100644 --- a/src/main/java/sunsetsatellite/signalindustries/util/NumberUtil.java +++ b/src/main/java/sunsetsatellite/signalindustries/util/NumberUtil.java @@ -18,6 +18,6 @@ public static String format(double value){ return String.valueOf(value); } } - return "???"; + return String.valueOf(value); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureDilithiumCrystal.java b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureDilithiumCrystal.java new file mode 100644 index 00000000..e8ff10f8 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureDilithiumCrystal.java @@ -0,0 +1,113 @@ +package sunsetsatellite.signalindustries.worldgen; + +import net.minecraft.core.world.World; +import net.minecraft.core.world.generate.feature.WorldFeature; +import sunsetsatellite.signalindustries.SignalIndustries; + +import java.util.Random; + +public class WorldFeatureDilithiumCrystal extends WorldFeature { + @Override + public boolean generate(World world, Random random, int i, int j, int k) { + int maxRadius = 2; + int maxRadiusRepeat = 4 + random.nextInt(4); + + int radius = 0; + int worldHeight = world.getHeightBlocks(); + int height = ((worldHeight + j) / 2) - (random.nextInt(16)-8); + /*if(world.getBlockId(i,height-1,k) != SignalIndustries.realityFabric.id){ + return false; + }*/ + + generateCircle(world,random,i,height+((maxRadius + maxRadiusRepeat)/2)+1,k); + + boolean flip = false; + int id = SignalIndustries.dilithiumCrystalBlock.id; + int y = 0; + for (int l = 0; l <= maxRadius*2; l++) { + int x = 0; + boolean first = true; + for (int lineRadius = radius; lineRadius >= 0; lineRadius--) { + if(!first){ + for (int z = -lineRadius; z <= lineRadius; z++) { + world.setBlockWithNotify(i+x,height+y,k+z, id); + world.setBlockWithNotify(i+(x*-1),height+y,k+z, id); + } + x++; + } else { + for (int z = -radius; z <= radius; z++) { + world.setBlockWithNotify(i+x,height+y,k+z, id); + } + x++; + first = false; + } + } + if(!flip){ + radius++; + } else { + radius--; + } + if(radius >= maxRadius){ + y++; + for (int m = 0; m < maxRadiusRepeat; m++) { + x = 0; + for (int lineRadius = maxRadius; lineRadius >= 0; lineRadius--) { + if (!first) { + for (int z = -lineRadius; z <= lineRadius; z++) { + world.setBlockWithNotify(i + x, height + y, k + z, id); + world.setBlockWithNotify(i + (x * -1), height + y, k + z, id); + } + x++; + } + } + y++; + } + flip = true; + radius--; + y--; + } + y++; + } + return true; + } + + private void generateCircle(World world, Random random, int i, int j, int k) { + int blockRadius = 5; + + for(int x = -blockRadius; x <= blockRadius; ++x) { + for(int z = -blockRadius; z <= blockRadius; ++z) { + if (isPointInsideCircle(x, z, blockRadius)) { + if(random.nextFloat() < 0.33f){ + world.setBlockAndMetadataWithNotify(x+i, j, z+k, SignalIndustries.rootedFabric.id, 0); + } else { + world.setBlockAndMetadataWithNotify(x+i, j, z+k, SignalIndustries.realityFabric.id, 0); + } + + } + } + } + + blockRadius--; + + for(int x = -blockRadius; x <= blockRadius; ++x) { + for(int z = -blockRadius; z <= blockRadius; ++z) { + if (isPointInsideCircle(x, z, blockRadius)) { + world.setBlockAndMetadataWithNotify(x+i, j, z+k, 0, 0); + } + } + } + } + + public boolean isPointInsideSphere(int x, int y, int z, double radius) { + return x*x + y*y + z*z < radius*radius; + } + + public boolean isPointInsideCircle(int x, int z, double radius) { + return x*x + z*z <= radius*radius; + } + + //TODO: doesn't do what it is supposed to do but creates interesting patterns, reuse for something else maybe? + public boolean isPointOnSphere(int x, int y, int z, double radius) { + return (x*x + y*y + z*z)+1 == radius*radius || (x*x + y*y + z*z)-1 == radius*radius; + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureEternalTree.java b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureEternalTree.java new file mode 100644 index 00000000..9f86ca4a --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureEternalTree.java @@ -0,0 +1,378 @@ +package sunsetsatellite.signalindustries.worldgen; + +import net.minecraft.core.util.helper.MathHelper; +import net.minecraft.core.world.World; +import net.minecraft.core.world.generate.feature.WorldFeature; +import sunsetsatellite.signalindustries.SignalIndustries; + +import java.util.Random; + +public class WorldFeatureEternalTree extends WorldFeature { + protected int leavesID; + protected int logID; + static final byte[] field_882_a = new byte[]{2, 0, 0, 1, 2, 1}; + Random rand = new Random(); + World worldObj; + int[] basePos = new int[]{0, 0, 0}; + int treeHeight = 0; + int height; + double field_876_g = 0.6; + double field_874_i = 0.4; + double field_873_j = 1.0; + double field_872_k = 1.0; + int field_871_l = 1; + int treeMaxHeight = 12; + int field_869_n = 4; + int[][] field_868_o; + int heightMod; + + public WorldFeatureEternalTree(int leavesID, int logID) { + this.leavesID = leavesID; + this.logID = logID; + this.heightMod = 0; + } + + public WorldFeatureEternalTree(int leavesID, int logID, int heightMod) { + this.leavesID = leavesID; + this.logID = logID; + this.heightMod = heightMod; + } + + void func_521_a() { + this.height = (int)((double)this.treeHeight * this.field_876_g); + if (this.height >= this.treeHeight) { + this.height = this.treeHeight - 1; + } + + int i = (int)(1.381 + Math.pow(this.field_872_k * (double)this.treeHeight / 7.0, 2.0)); + if (i < 1) { + i = 1; + } + + int[][] ai = new int[i * this.treeHeight][4]; + int j = this.basePos[1] + this.treeHeight - this.field_869_n; + int k = 1; + int l = this.basePos[1] + this.height; + int i1 = j - this.basePos[1]; + ai[0][0] = this.basePos[0]; + ai[0][1] = j; + ai[0][2] = this.basePos[2]; + ai[0][3] = l; + --j; + + while(true) { + while(i1 >= 0) { + int j1 = 0; + float f = this.func_528_a(i1); + if (f < 0.0F) { + --j; + --i1; + } else { + for(double d = 0.5; j1 < i; ++j1) { + double d1 = this.field_873_j * (double)f * ((double)this.rand.nextFloat() + 0.328); + double d2 = (double)this.rand.nextFloat() * 2.0 * 3.14159; + int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double)this.basePos[0] + d); + int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double)this.basePos[2] + d); + int[] ai1 = new int[]{k1, j, l1}; + int[] ai2 = new int[]{k1, j + this.field_869_n, l1}; + if (this.func_524_a(ai1, ai2) == -1) { + int[] ai3 = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; + double d3 = Math.sqrt(Math.pow(Math.abs(this.basePos[0] - ai1[0]), 2.0) + Math.pow(Math.abs(this.basePos[2] - ai1[2]), 2.0)); + double d4 = d3 * this.field_874_i; + if ((double)ai1[1] - d4 > (double)l) { + ai3[1] = l; + } else { + ai3[1] = (int)((double)ai1[1] - d4); + } + + if (this.func_524_a(ai3, ai1) == -1) { + ai[k][0] = k1; + ai[k][1] = j; + ai[k][2] = l1; + ai[k][3] = ai3[1]; + ++k; + } + } + } + + --j; + --i1; + } + } + + this.field_868_o = new int[k][4]; + System.arraycopy(ai, 0, this.field_868_o, 0, k); + return; + } + } + + void placeLeaves(int i, int j, int k, float f, byte byte0, int l) { + int i1 = (int)((double)f + 0.618); + byte byte1 = field_882_a[byte0]; + byte byte2 = field_882_a[byte0 + 3]; + int[] ai = new int[]{i, j, k}; + int[] ai1 = new int[]{0, 0, 0}; + int j1 = -i1; + + label33: + for(ai1[byte0] = ai[byte0]; j1 <= i1; ++j1) { + ai1[byte1] = ai[byte1] + j1; + int l1 = -i1; + + while(true) { + while(true) { + if (l1 > i1) { + continue label33; + } + + double d = Math.sqrt(Math.pow((double)Math.abs(j1) + 0.5, 4.0) + Math.pow((double)Math.abs(l1) + 0.5, 4.0)); + if (d > (double)f) { + ++l1; + } else { + ai1[byte2] = ai[byte2] + l1; + int i2 = this.worldObj.getBlockId(ai1[0], ai1[1], ai1[2]); + if (i2 != 0 && i2 != this.leavesID) { + ++l1; + } else { + this.worldObj.setBlockAndMetadataWithNotify(ai1[0], ai1[1], ai1[2], l, 1); + ++l1; + } + } + } + } + } + + } + + float func_528_a(int i) { + if ((double)i < (double)((float)this.treeHeight) * 0.3) { + return -1.618F; + } else { + float f = (float)this.treeHeight / 2.0F; + float f1 = (float)this.treeHeight / 2.0F - (float)i; + float f2; + if (f1 == 0.0F) { + f2 = f; + } else if (Math.abs(f1) >= f) { + f2 = 0.0F; + } else { + f2 = (float)Math.sqrt(Math.pow(Math.abs(f), 2.0) - Math.pow(Math.abs(f1), 2.0)); + } + + f2 *= 0.5F; + return f2; + } + } + + float func_526_b(int i) { + if (i >= 0 && i < this.field_869_n) { + return i != 0 && i != this.field_869_n - 1 ? 3.0F : 2.0F; + } else { + return -1.0F; + } + } + + void func_520_a(int i, int j, int k) { + int l = j; + + for(int i1 = j + this.field_869_n; l < i1; ++l) { + float f = this.func_526_b(l - j); + this.placeLeaves(i, l, k, f, (byte)1, this.leavesID); + } + + } + + void func_518_b() { + int i = 0; + + for(int j = this.field_868_o.length; i < j; ++i) { + int k = this.field_868_o[i][0]; + int l = this.field_868_o[i][1]; + int i1 = this.field_868_o[i][2]; + this.func_520_a(k, l, i1); + } + + } + + void placeWood(int[] ai, int[] ai1, int i) { + int[] ai2 = new int[]{0, 0, 0}; + byte byte0 = 0; + + byte j; + for(j = 0; byte0 < 3; ++byte0) { + ai2[byte0] = ai1[byte0] - ai[byte0]; + if (Math.abs(ai2[byte0]) > Math.abs(ai2[j])) { + j = byte0; + } + } + + if (ai2[j] != 0) { + byte byte1 = field_882_a[j]; + byte byte2 = field_882_a[j + 3]; + byte byte3; + if (ai2[j] > 0) { + byte3 = 1; + } else { + byte3 = -1; + } + + double d = (double)ai2[byte1] / (double)ai2[j]; + double d1 = (double)ai2[byte2] / (double)ai2[j]; + int[] ai3 = new int[]{0, 0, 0}; + int k = 0; + + for(int l = ai2[j] + byte3; k != l; k += byte3) { + ai3[j] = MathHelper.floor_double((double)(ai[j] + k) + 0.5); + ai3[byte1] = MathHelper.floor_double((double)ai[byte1] + (double)k * d + 0.5); + ai3[byte2] = MathHelper.floor_double((double)ai[byte2] + (double)k * d1 + 0.5); + this.worldObj.setBlockAndMetadataWithNotify(ai3[0], ai3[1], ai3[2], i, 1); + } + + } + } + + boolean func_527_c(int i) { + return (double)i >= (double)this.treeHeight * 0.2; + } + + void func_529_c() { + int i = this.basePos[0]; + int j = this.basePos[1]; + int k = this.basePos[1] + this.height; + int l = this.basePos[2]; + int[] ai = new int[]{i, j, l}; + int[] ai1 = new int[]{i, k, l}; + this.placeWood(ai, ai1, this.logID); + if (this.field_871_l == 2) { + ai[0]++; + ai1[0]++; + this.placeWood(ai, ai1, this.logID); + ai[2]++; + ai1[2]++; + this.placeWood(ai, ai1, this.logID); + ai[0]--; + ai1[0]--; + this.placeWood(ai, ai1, this.logID); + } + + } + + void func_525_d() { + int i = 0; + int j = this.field_868_o.length; + + for(int[] ai = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; i < j; ++i) { + int[] ai1 = this.field_868_o[i]; + int[] ai2 = new int[]{ai1[0], ai1[1], ai1[2]}; + ai[1] = ai1[3]; + int k = ai[1] - this.basePos[1]; + if (this.func_527_c(k)) { + this.placeWood(ai, ai2, this.logID); + } + } + + } + + int func_524_a(int[] ai, int[] ai1) { + int[] ai2 = new int[]{0, 0, 0}; + byte byte0 = 0; + + byte i; + for(i = 0; byte0 < 3; ++byte0) { + ai2[byte0] = ai1[byte0] - ai[byte0]; + if (Math.abs(ai2[byte0]) > Math.abs(ai2[i])) { + i = byte0; + } + } + + if (ai2[i] == 0) { + return -1; + } else { + byte byte1 = field_882_a[i]; + byte byte2 = field_882_a[i + 3]; + byte byte3; + if (ai2[i] > 0) { + byte3 = 1; + } else { + byte3 = -1; + } + + double d = (double)ai2[byte1] / (double)ai2[i]; + double d1 = (double)ai2[byte2] / (double)ai2[i]; + int[] ai3 = new int[]{0, 0, 0}; + int j = 0; + + int k; + for(k = ai2[i] + byte3; j != k; j += byte3) { + ai3[i] = ai[i] + j; + ai3[byte1] = MathHelper.floor_double((double)ai[byte1] + (double)j * d); + ai3[byte2] = MathHelper.floor_double((double)ai[byte2] + (double)j * d1); + int l = this.worldObj.getBlockId(ai3[0], ai3[1], ai3[2]); + if (l != 0 && l != this.leavesID) { + break; + } + } + + return j == k ? -1 : Math.abs(j); + } + } + + boolean func_519_e() { + int[] ai = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; + int[] ai1 = new int[]{this.basePos[0], this.basePos[1] + this.treeHeight - 1, this.basePos[2]}; + int i = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); + int j = this.func_524_a(ai, ai1); + if (j == -1) { + return true; + } else if (j < 6) { + return false; + } else { + this.treeHeight = j; + return true; + } + } + + public void func_517_a(double d, double d1, double d2) { + this.treeMaxHeight = (int)(d * 20.0); + if (d > 0.5) { + this.field_869_n = 5; + } + + this.field_873_j = d1; + this.field_872_k = d2; + } + + public boolean generate(World world, Random random, int i, int j, int k) { + this.worldObj = world; + long l = random.nextLong(); + this.rand.setSeed(l); + this.basePos[0] = i; + this.basePos[1] = j; + this.basePos[2] = k; + if (this.treeHeight == 0) { + this.treeHeight = 8 + this.rand.nextInt(this.treeMaxHeight); + } + if(this.treeHeight == 8){ + return false; + } + + + if (!this.func_519_e()) { + return false; + } else { + for (int x = -3; x < 2; x++) { + for (int z = -3; z < 2; z++) { + if(random.nextInt(2) == 0){ + world.setBlockAndMetadataWithNotify(this.basePos[0]+x,this.basePos[1]-1,this.basePos[2]+z, SignalIndustries.rootedFabric.id, 1); + } + } + } + this.func_521_a(); + this.func_518_b(); + this.func_529_c(); + this.func_525_d(); + SignalIndustries.LOGGER.info("tree! "+this.treeHeight+" "+this.treeMaxHeight); + return true; + } + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureObelisk.java b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureObelisk.java new file mode 100644 index 00000000..695e0ae9 --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/worldgen/WorldFeatureObelisk.java @@ -0,0 +1,71 @@ +package sunsetsatellite.signalindustries.worldgen; + +import net.minecraft.core.world.Dimension; +import net.minecraft.core.world.World; +import net.minecraft.core.world.generate.feature.WorldFeature; +import sunsetsatellite.signalindustries.SignalIndustries; + +import java.util.Random; + +public class WorldFeatureObelisk extends WorldFeature { + @Override + public boolean generate(World world, Random random, int i, int j, int k) { + int l = 8; + if (j >= 1 && j + l + 1 <= world.getHeightBlocks()) { + for (int x = -4; x <= 4; x++) { + for (int z = -4; z <= 4; z++) { + if(world.getHeightValue(i+x,k+z) < j-1){ + return false; + } + } + } + if (j < world.getHeightBlocks() - l - 1) { + if((world.getBlockId(i,j-1,k) == SignalIndustries.realityFabric.id && world.getBlockId(i,j-1,k) != SignalIndustries.eternalTreeLog.id) || (world.dimension == Dimension.overworld && world.getBlockId(i,j-1,k) != 0 )){ + for (int x = -2; x <= 2; x++) { + for (int z = -2; z <= 2; z++) { + if((x == -2 || x == 2) && (z == -2 || z == 2)){ + world.setBlockWithNotify(i+x,j,k+z,SignalIndustries.rootedFabric.id); + } else { + world.setBlockWithNotify(i+x,j,k+z,SignalIndustries.realityFabric.id); + } + } + } + for (int x = -4; x <= 4; x++) { + for (int z = -4; z <= 4; z++) { + if(random.nextFloat() < 0.2f){ + world.setBlockWithNotify(i+x,world.getHeightValue(i+x,k+z)-1,k+z,SignalIndustries.rootedFabric.id); + } + } + } + world.setBlockWithNotify(i,j,k,SignalIndustries.rootedFabric.id); + + world.setBlockWithNotify(i+2,j+1,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i-2,j+1,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+1,k+2,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+1,k-2,SignalIndustries.rootedFabric.id); + + world.setBlockWithNotify(i+2,j+2,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i-2,j+2,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+2,k+2,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+2,k-2,SignalIndustries.rootedFabric.id); + + world.setBlockWithNotify(i,j+l+3,k,SignalIndustries.realityFabric.id); + world.setBlockWithNotify(i,j+l+2,k,SignalIndustries.realityFabric.id); + world.setBlockWithNotify(i,j+l+1,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+l,k,SignalIndustries.dimensionalShardOre.id); + world.setBlockWithNotify(i,j+l-1,k,SignalIndustries.rootedFabric.id); + world.setBlockWithNotify(i,j+l-2,k,SignalIndustries.realityFabric.id); + world.setBlockWithNotify(i,j+l-3,k,SignalIndustries.realityFabric.id); + SignalIndustries.LOGGER.info("Obelisk generated."); + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } +} diff --git a/src/main/resources/achievements.txt b/src/main/resources/achievements.txt new file mode 100644 index 00000000..5289c741 --- /dev/null +++ b/src/main/resources/achievements.txt @@ -0,0 +1,115 @@ +Initialization +Obtain some Raw Signalum Crystals. + +The Prototype +Create a Prototype Machine Core. + +From Within +Extract Signalum Energy from a raw crystal. + +Transfer +Craft conduits to move Signalum Energy around. + +Primitive Buffer +Create a Prototype Energy Cell to store Signalum Energy. + +Shining +Cut away impurities and create a pure Signalum Crystal! + +Only The Beginning +Create a Basic Machine core. + +Combined +Combine 2 Signalum Crystals into 1! + +Challenge from Hell +Activate the Wrath Beacon's monster wave challenge! + +Victorious +Defeat all waves of a Wrath Beacon and claim your prize. + +Relic from the Past +Fuse obsidian with hellish material to form something forgotten. + +Totality +Experience a Solar Eclipse. + +The Night is Red +Experience a Blood Moon. + +Rediscovered Technology +Get your hands on a ROM Chip. + +Power Harness +Create the Signalum Power Harness and start using Signalum Energy for more than just powering machines. + +Knights Alloy +Forge R.C. Alloy from Crystal Alloy and Glowing Obsidian. + +Reinforced +Enter the Reinforced tier by making a Reinforced Machine Core. + +Standing here, I realize +Create a Signalum Saber. + +Pulse +Construct the Pulsar and activate its signature ability! + +Extraterrestrial +Find a meteor containing Dilithium Shards. + +Interdimensional +Discover crystallized reality - the Dimensional Shard. + +BOOST +Craft the Dilithium Booster to speed up your machines. + +The Greggening +Construct your first multiblock. + +Anchored +Build the Dimensional Anchor multiblock. + +Ticket to Everywhere and Nowhere +Create a Warp Orb. + +Tearing Spacetime +Successfully teleport somewhere by breaking a Warp Orb. + +Reality Failure +Suffer the consequences of breaking a blank Warp Orb. + +Under a Dead Sky +Take a look around Eternity and find out what it has to offer. + +False Eternity +Escape Eternity without dying. + +Empowered +Craft a piece of the Signalum Power Suit. + +Complete Set +Wear the entire Signalum Power Suit set for the first time. + +... + +Destroyer +Complete the Awakened Wrath Beacon challenge and receive an ancient artifact. + +ANNIHILATOR +Complete the Awakened Wrath Beacon challenge under the shine of the Blood Moon. The devil bows down to you. + +... + +Awakened +Discover the perfect form of Signalum as Awakened Signalum Crystals. + +Signal Industries +Activate the Awakened Signalum Ignition Facility for the first time. Thanks for playing! + + + + + + + diff --git a/src/main/resources/assets/signalindustries/block/awakened_crystal_block.png b/src/main/resources/assets/signalindustries/block/awakened_crystal_block.png new file mode 100644 index 0000000000000000000000000000000000000000..02c180a29b31e321e2f5fd9f3f418a79d8ec980d GIT binary patch literal 723 zcmV;^0xbQBP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0%%D@K~y+TB~ndm z6HydBZ(b&oq^V8%m8R{&g;3Or-Bl38g^DZjM+olR^&hxVLV)lYPx8na79amGJPcdFB&TBGU7dZuajApEkq?QubQ!Y|ja1Mjr5p-y?5$p8$(|LjXFMhs3_ZU_} zme5)cuG|TNKtSq3C(&?xdN_`b9XxBORV%Oxd4xQH(O6h>zI68mn#LHif_;m6-8l?7 z*>xZ-j4D7Gi3H6RP=Z>9xLgNTg42IE4QjzX`8trTvTPUTyOIN1vzYxvqSt^}N zOiQLij0YHW5T`<=M7$qq7N^o!_>IQxjmpy6!o6qKZ?I|d;nnu7`2#@;Dq~JIi&dUk zsxTRLC+e$c@1H+&`PYZHNBg_ED#-^ct@VYFc-4fT$so;ji73N_fu{=ky{~)S{?6CW zoP9D*V9Vn5;sF2v002ovPDHLk FV1nZ>P67Y` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/dilithium_block.png b/src/main/resources/assets/signalindustries/block/dilithium_block.png new file mode 100644 index 0000000000000000000000000000000000000000..6c3ee8e65a181c7919cf6bfeccc23f18088efca4 GIT binary patch literal 668 zcmV;N0%QG&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0x?NMK~y+TB~sf? z+dvTAiybF1xe-)Asz5wcLVN+dRQ;n0^*5_NR4T11R8^F!X(5RneA(OV^en8_)_A>h z&YUwNuiw6xQVJnrj0luc-g~VzVrItq%X<0Dun=9IUmP7ADwfW8W9*xg)5nKL9hf7p zO;gUwd|Y@AcdPr4U%#b<>=ZLk;mV?Q3JS~@#n6dRe_!WpW z32YHq5UVKgmR?53$ak&lHm$3TbgV_HJmt9Fn%3CfIBUs=NJ$JMlVxzBshaI-yL+fz zW1&;w>AN1=8b>ZbyHMir?C9kDbx{;b>kz1^o6TyoTh|F5UB_h+q(W+y1M{eu&G7ftXV<*7aRCUCv=t)$BmmneOc3lmJFSE5Yd^Ck7cAz6T0} zA_q3?MD-+CWGb})Uig3pC3`dyAzY_4fodXcRu3}3F_J8_(qBH^w0#FGR3$U$2`ORQ zZZn-_I;SWoP_?e+i}`e3{{D3bRF;CIG)mk){Ye^-Fq)L*Y;QOmN+HRU4E*!v$L;6u z-dX@h7Ex=;m6y*=Kv{Z}k7i}Lm<-1wU_gU|aO1SdFiaRA8fe`149_Srz!0ya8fW?5 zK;+UGqjU}|XmV0m&3*KJur9cSesy{|$`v|XwY$wzwXU~CEYjeK7-GEd9&6v$X1D9> zs@=*wlONt)gCxm+ZX#mn#1y}rB;!FvsRQ_>wf+w+@s<;F_4!=@0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0rW{kK~y+THIrLb z#4rp)omV>yaA4i+icRp#COFXM$(0K!=_IKwOL7PwZ||Qgm@S^bvz9UD^~+o=#$d09 zb%>)x-|fe?@Cv7h`{Iq=1-XaZ;o_^t{@p~7GMKb=g;YKyci&XZ;qvf z4<)9n!d8lfOdXx+h5mL_s}2HVz;zz4WTs+Ch!_)+X0nH;n?1ffQcW?}s7R^uMH0op zPxXe{XdnYEWV~|Cqj!6LeF8*kk;8FsopZ&Ks`gCG(hSg)dAR2v7bYa6wASnn8&wpS zMsfv2vH)O^9F>gw5xS{l%Nu>(nFW{BJ|s!4gAlXG(SW=zhm6z`K7CsKI{h9i{4o9jXch2h?;oWY$8z02j%AUr14`8}DoYkS0fhVx)cAEMiN}+)64} z43j^iPK%X+SX+OcaRxFg6z=zysleo{*XC{?$KjQvTT&4(%iM5%h)NcnE{X!#(aEn^ z2}DVvtr&GmLJ|g-Z6ijei?-+yPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0l7&;K~y+TJ(9@^ z!cYuF?cj`BZ9zp`6kG`I{0o0i{3~(c!o5(ijyTq_4kt#;qP~~hn|qU|(eL*S!$>3& z&*#(p#{GV`ZJXr#{U)!WSMpNmcDwa@o$U2`y<9G>R%^Lj!Uu6Y9*f0dHk*CDUO^Cy zMk68AYPDvwNf~q$MXS|{LmbDJW##jE$8jo^3d*`HOOM9`D6-0@D}?!cj_i*{7Bm5xak+x_eZSpqXEGUvq=j-en~hka?7A*c zf*OQswTd)?otonm&?=XRB234N9N`% zghHWEDwTLn&UAt{nM}sxF@s@-5^v9Jf+i560q@U?=5jgp#)=85sZ^@bXn3B->Nv|V zbj2B8X#5c{#+Gmh8Yx8d)%YVF4hQm9uh&y5_w9De>nK!%d6;mqSj=WKsPx#1ZP1_K>z@;j|==^1poj5pHNIxMY6K8j*X3(mzSNJo1UDUtEZ>5u&}qZw79jk z#lphi-rnfv=i=bt;oslh+}zsO*x1(A)6mevz`*?c{Qdp?{rvp<`T6(u_V4cQ-`w2$ z`uc!?fcW+Sw<;aS3R_iSHp*}Aw`XZ6nK{zB*jhHwo-^VMNO P00000NkvXXu0mjffYsra literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/external_io_both.png b/src/main/resources/assets/signalindustries/block/external_io_both.png new file mode 100644 index 0000000000000000000000000000000000000000..4a8e1eeffbebf098327d67d5a3cfaeb5d951d199 GIT binary patch literal 379 zcmV->0fhdEP)Px#1ZP1_K>z@;j|==^1poj5fly3TMY6K8j*X3(mzSNJo1UDUtEZ>5u&}qZw79jk z#lphi-rnfv=i=bt|7rl**x16n6=2M{ouFP4a_wP`>EkZRLzF|^woB}dSQ zBgIZ3#bsytGECF002ovPDHLkV1j%2z<2-v literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/external_io_input.png b/src/main/resources/assets/signalindustries/block/external_io_input.png new file mode 100644 index 0000000000000000000000000000000000000000..95be0088ca7c5a9926206524f063284fae559441 GIT binary patch literal 375 zcmV--0f_#IP)Px#1ZP1_K>z@;j|==^1poj5eo#zQMY6K8j*X3(mzSNJo1UDUtEZ>5u&}qZw79jk z#lphi-rnfv=Kv=E*w)t5(9pxcz~0>4{QUg={r&y?{QLR&_xASh?(W~*-23|afPjGb z_V(D<*ZlkYKtMn+Ffji9{@vT#;NRcy@9*{V^Y!xb`S|$p@$u5n&(zY=+1J;3KjgIl z000SaNLh0L01m1(Yuyw=WEdPgmPx#1ZP1_K>z@;j|==^1poj5eo#zQMY6K8j*X3(mzSNJo1UDUtEZ>5u&}qZw79jk z#lphi-rnfv=i=bt|7rl**x1@AdQZ`S|$p@$u5n&(zY=+1J;)M@m`% z000SaNLh0L01mNS%G}}0G|+7At512Nl6(Q8Ch9bIXO8&K|uil0Z~y=adB}82?+%S1!-w%d3kw7 zMMWhgB`GN>H8nLA6%}=LbyZbWWo6~Wb?>EtMsXH+L>4nJ@ErzW#^d=bQhK| zQWBrzcr_}&#^IT}NSKJxsy9!SSIy|DjJvW#?_$Qc>WKf{dC%`Y-=2Kt;pFuiXRelW ty^5OkFkyezs`oc_Z-~`azjNlWXMV`KI->dVd!Q>AJYD@<);T3K0RYB|U_Af; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass.png b/src/main/resources/assets/signalindustries/block/reinforced_glass.png new file mode 100644 index 0000000000000000000000000000000000000000..699c909e33f661174a5171f802576aa17f6b61e4 GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!MC0+jv*HQOD7-XYH|>0OMk1>Cfd#6Cfn7d zcXe~gi=|b4e0Qs6@X0P#5LIT@Rt_=yyOrCu2GSz&$~N_zS6ZYipA7}-3JfNp8WcfvHYrsDP6bh-`L;Q m+u)u&>-*fGfVF=aE^^O0<<{2iv`Gl)aRyIUKbLh*2~7aW&xBzB literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..9576944cf007fb71554bb70e6537e95f39b886e1 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL3d9V#}EtuWC_;A2_if~2P!^1KL20g*yh*M z4>B2i_;u5`ZT|gzhAUpZZ2qY)XPfdsT##|Iql1t0^u|`fjD`sl1a2^VVqj)wxECPs U=u2h|2hd0cPgg&ebxsLQ004G5RsaA1 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_left.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_left.png new file mode 100644 index 0000000000000000000000000000000000000000..988b17e4ba0fe2096ab8b6f14c2ef075b7345916 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!5N+|jv*HQYbV)qF&T=qsBiRCZ#gQ>VfN~x zZBOgc3_;a0M{!lo)idu3pZR5~FI*x2v+~0|{-skGmC9Bbi7c5SA@Z-7>A6fZ6YJJ6 zHdd}RSMv{@lTdDUncZAI&yt<{#NWjV&(ADyXf!mI|CpW-xIn=!o`-AM-$M^;oGoOR zubt@5@#Bl_wcWO#|5hE`^m<3$8nfsyt{syY_BpN5+FG~jzA4a+44$rjF6*2UngBou BTebiI literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_right.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_bottom_right.png new file mode 100644 index 0000000000000000000000000000000000000000..74a9fcfeaf9bf099668ea7f1d9a7cbce1c522895 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|m0G|-ogCBni2?=#ASuu0luC?c{%-FiKYsvEEC(g{E?wXI;U`ejja=phKuVw_$S?RmDqwh^94iTw<1FxqEM{QfI}E~%$MaXD00nJ4 zT^vI+f?Lm63Na`MFgbqM_xFGP-4LEREvxtr>|?5bAhO3Ppo7a(QCp;S)rEcX{3T2$ iuB|9GyY2d+%SQezPqOm%MazNaFnGH9xvXHhGo6o(n=v0UKxA z?Qiyf@FIFgh2o;50GC-oA8#D|dOnix{sd>?Rcp59_G}DwGW%Zs+je%TwIq`wOIyp^ zs@BQ-6}F2B8yquG*-_NSY2tf$LV?{I!$zIS_f_t!n=$!bbz4i;#v?4JDvwV1P-SD- zI8W%m`>P_WB&O0>V-=q+CgBTGohRlV-ak2Nu?WYHcaADN%T?7jNcTtx9sBm5i}TCQ atwHj))@j}qi(3!!G=rzBpUXO@geCyDENgcF literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_no_bottom.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_no_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..d5acb6185a9008270ddd93bd5eb12a58638ff16d GIT binary patch literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!Lyz&jv*HQOD7-XYH|>9y|2-jv5ZGZVkgI| z=3i^~Eq48XnSYCB@*>VP%UYEu--~hCot|F2m*@Qhi^UUytbQ?bObJqHQOMS{e11Zr z`KZCX2|L3p{-wTm-xBx4Wv)Z^*}CqtWzTm-u795+q&ZQ5#j)X#;^}k`j#6wsNZ z<6Nh9JKIKtBjmrMMa$)H_8E;247vg=dY*n4V{`t(rg_)Qq1E?D4bWo@p00i_>zopr E08@Q*1ONa4 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_no_left.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_no_left.png new file mode 100644 index 0000000000000000000000000000000000000000..d28e072d74f3c8ba01a6508a5765535c9be27787 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|~0G|+7At9kZfByXa`}gP1pFe*5c=ztzkKca|e*D?BWW~&FyVjn+GGpt` zt|iNtpExsb&%y2`D`srjvGLy1N$WOkxO9E*ho3-W4)k7I45Y+Lg8YL2V*?C~mkvAu zs^Bc}h%9Dc;5!V$jK}j=qyPndJzX3_G=h^4F!c2JoY7gcCTC5;fpZ5Gx|l33uv%PX z-Eo0+$3@nP3#=6vS$|w${c(|%g=1EuqQZ#-2hN@2W^wv+=n#`b6w9kri-ZIQhM$l5 VOH}V3`3*Ff!PC{xWt~$(696w#hq3?w literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_no_right.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_no_right.png new file mode 100644 index 0000000000000000000000000000000000000000..c827b4f009b4ed0cd432519b6cd3da77308aefb3 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!A+hnjv*HQODAvSI%FWwrvFk%MAYdcFN^rs zi?uWO`W87);gDRzrpmeT=k1dpKk1g&d)r@%^Uqjo9LmtRby|ynNb-_7#+C02i?>Bg zdO!cg|Ch6V-VkXl?yKdp3^fzbSSn!QFd@k40Yl@IKjsG~r*h?-60uXf=DSew-+mTH z4#q}i7N?N9BL^D}F*5zGQZ6`PBzxZ6XnEc)lTQY1`wj=?eq(>~`>WIHZLaYV`Q2 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_no_top.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_no_top.png new file mode 100644 index 0000000000000000000000000000000000000000..8c214c4d60a4834e9f25e438751a0b8d29e8825d GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!Hb?Qjv*HQb0;69y??{4DS%B-tw@+N zch&lr*0En$b)&auNV4`W3Q^Kl)F)pKqXc*~ImMz!@hA z)+`}~f(rY111`2Bb?zm;NfNA~p^60(JN0^)6cxn!o*%sLsi+_vFyWi{p~M&35heCo zR>zj`SL^&av1QpN4UL#}6DEItx&JL+{k{cXLu$EynKF0Sc{f|hS${jr0`we%r>mdK II;Vst0Iz^_-v9sr literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_right.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_right.png new file mode 100644 index 0000000000000000000000000000000000000000..814272ec45d853954bc9efde835765edca9818e5 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enFxb<@F~q_@SwZ~I&(F{IPnd9_UQJ_uj>9&_ zo}QkBSvkxNaSWGJq(A)sUvJ>Mjq(1zTIS2l;vF%2Y7%DE=-2#XS;l^j+rVHF?~XHP gc$aCGFfubUEMG48ulSa*JkWRsPgg&ebxsLQ09r>pZU6uP literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_top.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_top.png new file mode 100644 index 0000000000000000000000000000000000000000..bbcf2341d4cc72e09593f7fb7920883dcd56060b GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(B9L93^WR`_b8}-; znEmko|NlJq_ti3c7k&I>So8Z2=NUKl=`(jOToY)(<#sTEfrp1di%0Mg?=HrzK%*Eu MUHx3vIVCg!0Bp%J>;M1& literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_top_bottom.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_top_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..b0391ebe07e14e32594370f2c14272e02639e079 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!E8?##}EtuWDy~uU*{bd6aIXD&VPf!&CQKX zVfMrS|Nryc-&f1*UG(vjVa@M9oM+tFr_bEEa7~~Amm4F8f!v=T!gFTMi`~y7*3fwU z{5-=yENNPywzUTTk1lTK`J<$iV8+pr`JyS4YqK#kGXpcT(!Le1j;;h+%i!ti=d#Wz Gp$PzKkVv8c literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_top_left.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_top_left.png new file mode 100644 index 0000000000000000000000000000000000000000..686dfc1e3c72cf373f5be4d7f5edcc71bcf27469 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!9GtH#}EturIW4sm=$?kj;~Q#*gL7|_kAt# z8?%~}nZA|ZNxmmfQvUNl>3jE%;SRWTjIVQ4i={euT#(&c^G?s1%Sa2ZclTbNx rGZX8_zljSS4whNkw>8|eVXWI9t+~qc=+Stf%NRUe{an^LB{Ts5t>jm} literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/reinforced_glass_top_right.png b/src/main/resources/assets/signalindustries/block/reinforced_glass_top_right.png new file mode 100644 index 0000000000000000000000000000000000000000..e1c442e621952cbe03c6bf2aa6493edc54b9e5e9 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!C9Uzjv*HQYbV=s9dZzGOW)FctR+!UDT1R) zVf|A}ojv{OAJ~s@1YS=|ymJ1=jh`>G@9}W=-%YxDCZ^6I*o$MuDx0*z@=n7?2B+DD z&htL=zjk-t8THWJf;!W*>+kKm{4PFt#=#PW5ak(sGTWqQ@R=-^TE_hNCC@VE?WaYT zF(3cSw~VFVdQ&MBb@ E0Kddv&j0`b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/block/saturated_crystal_block.png b/src/main/resources/assets/signalindustries/block/saturated_crystal_block.png new file mode 100644 index 0000000000000000000000000000000000000000..9f1c69c3c002fd28bb0a3962a603321bcfbbcbe0 GIT binary patch literal 664 zcmV;J0%!e+P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0xd~IK~y+Tm6F>| zQ$ZAl|JkQP!G1Rp>XO}z01^d-3W1$+x{i7{$y6p#oAC{XQg zY4@qS`!FZ>kn#Yo%v}64>s!gc)*^3~9^rq&$nML>JGeOuc^STo_?Xn5i~6y)5rDHM zBO~KQtx$-hIB41R?}wVAuI0(qIZ~S@wN7kRVORcGZTd@ z_Y9y#&=JHYx&az9Xq3@15HZmY;rXy_oH~f8DaAR^$)Pz9dm5iyd~IUSQKZx~Xp%Cx zT{M29)s%jC4#XDP1P4HS2tf|i!qPHstROcE&ESl4*I_3|Vf%Cdkb5sMb_Yag zRj+>rfE&3WSxF0mAdPX_z{D&{%wm6$UYHEX_@=6T2AG90OiW=Yn~SbYr(A4& zNbBn&jVWVTUdX?Fl3ah-kyi$Q934ifjB*9}5(vpW(5ROtqlT=K?t}c=Gwc4P%Gxq3 zD~Ae5Az(=qhSf1MFCo!~wA~utn+v;!{rY3@KG=B`xSjbdSuNjz-412ufXIF?N#iOk yrt3nQoQM;d#9N2n(|3NybHuOVY-sX4r2-FO*$nhby}1xX+cHS zD9KQ^5|b2_olx1A?EK!*@;%?{I@k64_xGEB-uJnm&;5Ds`*YvVeZAL2+3ngcC9Wh6 z0Fbh_qV53z0ly-EC<=af-FI|=7suJ==62TR=2$yFt{dB%1%O7~rSpbXC^N+qCF-Yf zvJz^i9KB^TcHYEA#87vmPsCD(H#N7!X)qhJl(Vx}cw;2aRou(Ue)q0yuMApR##wo@ zh4T4{q?lMN)t44`jy$HS!^H;2lC=ulWHgKV)VFtiXc#}UcXH>cRo4`g?a3`=R8MuA zw#KuVGR(j0w#JPMR96vS;I>LoBBp3SXX=5O3SuqA?QP zdA-i;(&|6!tJij%%DQ}yb~ECYMWx)}%Cl~o&ZEce*VSsc*n5B4SCbTaSK%*({_2bM ztcN-;6y?fDDww_t}PVMLUksHs_FJ}vmZ2ck~9`w~M^zjbs z4ub~M!>!KC8aSnmcY2SghO{=yMyhs{;b*T%Codixf0eVU<>Z|JgCb3@3jOO`%2#u< zAl@PIYDu@;;SgM#uGFhW0nz!(fO}Hc7ONfmy7pxiElV)0PP{idIP;=)!MJO3`<(Lf zalcPZ8%vhM<%qZ2>0kj@r>3Un<;$0S0K9ndVsUZt)vH$>0CWP--Q8VVTl)ck+qZAu zxpOBqH8m|QEj>N`?%lih?%lh8|9(bBMrLN_g9i_?va+(XvvYECa&vR@^78WY^B+EZ zSWr+5z1dHeS5yLayz8ynxhfB)gbhmRjWHa9o7w6wIgwzjpkwYRr- zbaZrfc7FQwsi&u>x3{;iukZ8c&tJZL`TF&1e}DhLz`)?(;Ly;}@bK`+$jIpEXj4;D zS65d(0B-0Qj)IvN8vNTmT*d zPzb<10I~tN1uFwUIskV8NB|%afExg$0B{+AD*(g+a20@S0K@`t9)Jq~kjdoe=x7fQ zkFl|_@$vDAiHUFDzD-U}PEAcsPfyRx%*@Wt&dtru&(AL`EWmYX(#&p!A5pwLyX@h* z{Ga%N*T)KB0f3mV)qZ~fmc#NaFF_b!?9~ClY-2k(@*Hh;8Zo#WJe|pPW#NN4zAzd9 zZhX3=ItlL~Vk$wib-g@;~gu zqX%pG_^W*<`9VWv`7`|3zC1S92P>qdyK)0~CO9~b?*VdrZESwA`}qIR0ak<%O!p;_ z@I(TKBaC_p?a#9agq?rH@~>!rhr_-s!XB1CH^7gr;&agwcXmr?iX5^wL6>RyW{~Y{0qfnyZuL-|B6SrvlRZ%!(q2yeE)^~ znWqp4i(y3NG6ID0SW``K!b6RiTn3wIwDhWN$RxY!xEX4>5)H{(x-0`%Ed#nCU5i1| z({uS*rh(s-2Jwv7zo#m#ZrOP1e zl66RQLmeIMpZ>OfY`FF4-v5k8$iswr4C!Qswzi?6mY$nF?5)ev({d%bGPQ_0BqmHk z)+I5RI4qN4WXbj8(BYD?Idpdx!PmzfhZQPoWM*e=g44zme=P01={z?W3imhLhsh1{ z|6zAvb6EB~x==cjKG{&0q^qy3t7Ayi*Vg-i*vs1XHp9(8he;-C=@S`laD}yrTCNN|vX-7MiLOU- zW57i-`04M@b>jum{a9x1uxhY4aN8}3gVp#^kBvW(K^`oj*swrwv9LZT@8?hxu6_+hmJcj|A3XMsSJ-C&AX#QjHFF4d z8Ayl=^s4TGX3pRqJzk>}$H8M32dwTI>(6 zgPFAR@2{H{&dHcUWH6eyi4)pyu2q*a&jI&3>^3{Vchs` z@8v6*c$fWgC1L49oz2btH77o&r&mXfOiVcCJ2~5`#;6WjCbe5yT3%QFbL*_(kw4X* zoqBDgNf{fmqy(7(n8x6ndD5jO{qOE<^O4x7)6 zzTO_@*!-KbI2Kj(8RV|Z>M&i9Ix;;lbfA2GL3*9ILDjT$@7Ui^mu9=VghBCbD83mn zuQrh_bOSrD<|+XdNP0-$KlhUH`S@+*-NCmx^UI*IZ1Su2(l)uvve3(&Wg zAvlQrXpe)69uE9lt8O8v&_hTumcfWPm@ijYoF0Ao;HjU&9od@!j!?Iy zUqsoCu*LBW)1Scb=;j=xAF}&ItW&b-@6p)M;gl%%6~i5|RgR7>DJv<+JWLb#P3)1F zsJ?aA->dunF9cPtd~dAFSth^AblNOrGi_q9rk zbn(m5l)@s@Fmfn6iru#AHY_dV+7&R*vPSCqF4x^!S;Be_3J`jfO%zGy3Ym+EUG@u+ zEo;6h(-7Amg3ctPBhegX!43{Iw{H)s9-RWIcmyLmR+AgvylH8%74{a?HqM+i{S`$72Mt%dK34W4Y{_onVdZM$=w*L^?7ME7ueO4WEeuApslu zG>-P1DWD9mk;DkRwp~~wLOo_6Bi4$nmtT+U%a5_vJcW{~dvGKW*#uQ6G#vZg%K64? z2=-(tXv^)XP1KX83`vagDR3sYL}c2m_+B;l(3+=2jx7%NW0=>HX?!aG>$c+V8UcHE4nDvW+n#S4B{#qo9Hl4#z|6tSWS5 z1sCUVc018ePi&}h@H&Z^^zDX>GpBT`KMtL8Zat#1vM7E1>sE#?|3($mE2gJf>_BH!6w%t ztH7wSo@VD^`vG%sr{W~cY zQ1!;_wYHWPuBCR6B0L#{ffS~O$fZ@vt@ONc5DlLgd{0a*o;yezv$2)dbQGtdJ`xb3 zR#I`I0uK3fk^gpbTh{Vy8eClC5k(pSDrnKjOu|(4C||fC=Z!hgY6+CE?y!hNorqUt zb&7tQq_lZN0?^AcNARhX-vl$Mi-U!`7w(uM#X>hxM&l(E|1g+!oMG`UUd)Qrmx(3O zaI~FG?M`evP@(Z=a$sO5xwa#dFn7hfL|19OqX;b<#n&b6yrr6Pr6NqP&WOA#&6xqqZBi z{Cy$A^D?r5QY2c{Qzsrrl=r>KLEC*x-+2A>1g{HA(||nG5L52Ot*de<7KSz}=u#N?F|M8`LX>J-S6SR*$xUCV{GI!z1t1pojC( zQ4z%}`P^{#YoY=@ng%TtC7RfKRXl4Dx{r_rsE^%kK}ZKPbBRbC&5|IxQAu<=C41Qu zfc9Y?601_wcnFZ>oFw${y7R8dYzeHd8r%@7xh+$&H7G>ENM-%&Xk7g2CV9lh=8M(& z(VCRHvtvV6`W2Sbjko9Lc8uY@ldKB%ZbYF_2Sk=FI~*@Hzox~{?Dl~_UdBJVt5>X{ zvJc}f$vX`_7Uj2!wOFWCuWWUE>j9DTswX&)lWg%??_QS8pSZCa#lb^P6#ZRHXa45c zIag@=TX?Sa_kOf;;vZ5>ROI7^k+B8*Tsi*q7}8S{YUKOg!0bV}z@wY6>GIdR@p+V5 z=n#s7ql_t_;rpiuK@DJYY)rAWL@eZ{6{{ogL9W+<^@o(I9zsf#a6M>!>`lrbaVm0E z6AB?`Showk!WoQ2QGv2XCZf1HG7nNpK1!k?oCCo8_=6j{XmyG$q$?K*`zo8l6Q@=#k;sGFV1N(Wo=U3c(SC-O`BjS#opCSz%;#qaqk z3E(=$>NBU{d^@I3YkLZ)Dbh`W&dT!1?M_aok;I{T8e)8#u@`wH$Fh4B@8xdLb5JQk zjWW2kP%aA;FLPf39lm1OD=L^3SR&$r*u1l#SRvr2@nd$pSX}wgeUtJ-(L)1O2TLWWfmkE?7cy&LO z$%2+eL_t0KYVtl-1#SDmAFL54>Ji@IQ4|wKKx?+2|KYS=tSIV=-l(IfBVT$6Dk2d_ z^KC6>1o@=q%a-p1wMD`GwF7zjt{b7Do6N??tQaa{H*^&|y>zYR`AelJWD3whgpn*Iq04g{vxR&buM%xw3UYGbulSFPjavwQ4+8n>fk&A9O~2@ zYzcQO4*(a=9?3%jCuPzK{u&Zf*cd5b3u4a9{<}h1@&el?SQJ@v#Ij#P_2K&0ySzJf z1M*p_F%=Pr3|ZQA)qsX(+=V3G7|HkF-NGt2{1iBL7V20ttU{S+*lkkYazY|4aW*aS zw}hGZ$SnxJF&$Ht(FEV3>0;U9t=&m-Q`^_g9KKq2t$kcEX+>9P%19K^6!T)TDzPZ| z=Fo-fa~I@G?sAz1JdRB%BBbrs7> z)`Cb!UBv|?AR-n7l@*jKpkP7j3Mj&NgXOosnVtFm`ewe&Bzenoo^#G~-uI*&@b+|( zC2A1?0FZTab=n93AT|U6NeS#NvM9h8o1{iKI(oY~I>O#@oY06UHUJnl|C(*%D&e59 zuSWkDJw@qd=>buS#qQ_z1P7fq;Pz!XjgmUMatv8*W!mNCDp7dp!wrRH<r0>%IqIELUf66^w?UaVlht^f+ zv|Zohud&$mNHLB2>z(Rcwip|BD;~?&-cvFFRgHKQCx>^-!pB;CQOfPmc_@`9!_i^e}g4f%<;+ z_xFxHVP7}Duc55pLJ43TSmhjY<;A%QeYX9!J3X&IEBBez|FL()A;$6YmfiMm<&zWN zh3@=wz1vIc*40Vffs0zBYuoY$cQ4)1-KMyA>B~Bk&nM)C^IIpIuBdgT<^613X&l*L zb%ukyb96}L1rzVdgkBxpq1R&}+tk)V34A*omfOG5b^WIPO=XpfezUoEws8Ezr~BP= ztNN#0X0_!e<6gC|sFB0UVc_lV>%4pSZWfD$)o5T~;J|?c^Yil;FJ8>c%e!>xQht8^ z<;#}~3JMAf3yX@1ii?X&N=iygOUug2%FD~IT)A@f>eXx4uKn@HAJ?y6zj5P6MMcHU zn>YXb^Uuo4%BrfW>gwuSw{F$c)QCi)+S=N>y1Lu9Z`aq?-??+Ap`oF%vGLx$d-w0( zfB5iWQ&UrOb8|~e%abQho<4p0*I$1gw+9?&<02 z?d^T}@?~FN->X-zUcY`lI5;>oH1y`po40S@zI*rX{rmUB!^0mwd>9!S866!R8yg!R zA8&7O@9*z_@ZiDSyLTTwdi415>eEy9|K&kj#t=8j0F4NK2{wJdQJ-xgztX7d;@KRPNV-j;8tw?J%* zjm68Rdhh~-7ip&#;NcBBa^l#qg^7g;h3w3aNHEjGNMLwX94pjzqtn`NB-qSOFPz8Y z+M1dsCMKFBnwxOq!c3_)Ha4adGgC7&GKL_>C&lm>d~!_uvaclHXq?#b%(w_HFM<;T zi)k4loS%7idRQD^1B~W+c>G|GiT|bpridw@!8N6tP)wtv#ZfPy<9W^rnDMt*{uLeX zo5W?CZe+)EevV_ZofFtGyk+0bSKby{R1t| zIxHfZyI_GS`~$^{2>p*X{}qpTXCeIW&M~teeE)^~o~IayiDB!+Vg4+R$IZ!3Pwdo| z#bHLUY!`-RHY{3*d8iFJgknP@Td=J|$kq%S2AN5b8Cc08q8VXq zQ*KO{9xPVY*1_A&PS4DQ@@?uJ#o&cvQ0#n1#IQJt@!!^cBcj^Pco$`P&8YVaNVs>Dyvd1iWz8Z5hn3Da11p*qEYU7n$LVm@qch46t+f zbtU3oYHh|0wKiwbC}b-NGZd?^8HF6ew4{+OEvO7jYA6#cn)P@4cupuUkrBss2*Xsv z#KDf;f;h0@w|cDjj!X<^i^awS!ir7)k3g94rvJ!em8tl$|1-B$rvE0xSKL3E!~)0H zRjdPHGtBOLQxngAG)8s|CO{n4_EH;sim|rZ>*nO(%ilKqTi8w&7qxxmEOKpwQ@_a8 zxP1UV)~NZ@m1}gF2KwB5Zo9UpU)S3Ynh_Uo9ob(nl`4JWb@r#K_<|j+T7M)Ae+r4> zY3S(8x0+YpT6|h#Nh5Hml9q6AlrYkLHLSV2`t!%(&uG_DkodyzJ-4-|g`{Gdn!xbE)}^UE*Bb zo%JV{m%4j2KYX;cI^j!0Q{aueBc0WW^R>6r4liwLHZ?XjF(I4UC(r5+j*a)#&7Mz_ z|IkypGi>%_aUhKoRFm-c+s^k7pI&vZgiR?EO9zQG(=A6I3gOl~OGpelxvp7jiMdgh8dAFvkUOq+5YP~jaxP9! zo}Bi%Dcw7C#%{0I7&G}f;0lZ{2cuA&D?VI3pt`QQXUcRP4bf3KimoRZof=1-8)X&_vFKG*?j~Iyv;mZe<%Af;YGhO)l zR`hn-^ry+enWJch^g4W*hM_1%ZJz1-u z+L^5kt&o%p0LSgq2^VnZ(8b|==%uDQc;;wtquN==*;V!*5mjNNNJFSpe-JK`u=}Y1 zvi8PL_86iv`GO%hqohKz_n3fBx2Udf9-koOTNLW+y0sJ0UB{#iGc*$v-q&G~kxFwYHT~oB?DJBfjKtoFLEPQ49 z3N)lIlr2*g9&F(W<26}?I67^Z1p}X=JNUS2VIX&OO z&QS8uz}{8xzzJ14ey^oamGW7b%%qdhP5T`0si*Ymp+_Vir{>|Ttc7WCjVgQ^ElLRh zC$_`Bs4UM{m{CHkkQ6E`_u81Fy!^-_@?Iq$mub)+tx_n9qz@B$lHtVyISDKhWvA3J z1$UN-%GnEtCmgk*Ct3ks_$+e@U3*l0bY=K~@Kdg%#`dTV3F2y%bqIaYVEIth^w01n zc$08YAlcMTG&F%coww*YIgW}3W{S}Ysdi$EUZWA}tdNlM`ZAoFw}lXdt5WbZYH*r_ zH%n~*SOWWSd``4?LJBuY-yg_;{X`_>1Fq=+$N|I9U(f?W-Q&8EsdIsYflvsZr(>ZC zgV!MvtcASCH9bzdie+YfnnKFl7l41CJ>HXLubkxvn+P5e_gW(1bJtOEUej(X)!j%( z@PYUX@?&X41piEl!c}dN+3kzR;(e4lNU&5SUm$shoIX1dww~Sv@s-218yAnxKUwr9 z_A#1)N_z<8%IW&)&;X$`!$UHiP$U>a=kDpmsgGWf9-|kCaKbXt|B-4<}pWe|22*da;i*6=oCSVh&y@W?g|sgUn|JK-~SwLvs{6&Lqx#sJ+UT} zB?BiS%m0oQWB_tS?gs5CuHK6Z&~*qQYh~RGO;`9k9FMM8b%?7dJg})&mHo5dPa<%I za33H6%*=a%&of>Eg0frc=_yoDtE_dBVck&v+9SXAPfCdWPuc3l`-4?Je;iVp$n;=*Ey!7#nVg6A$o2)+& za-*y$MGNLh2b2Qw9xS-Aqs|$?hlTKy;t56-r&My}($P*40WV|TQoh10&=9`0)oUds z$;J;}AvqHdMgh?DC5h*jzfZ40X(Cv!cxP~j#2;l08IS&N0 zJ|V>jpV|pLR>jHlr5n%gS%&mfL`^x&e4xbO$l!00s1cg0bT!36wNVDqU3*jE&T>o7pBm>bNOS;B;k zc=UCcL^~lB+={*W;HQmbEzw?^KoV>PE4P%Og4xY@zM@PaVg^HWx@&SUc*LGaSuY}L z_<|nI?Zly#4I%jHKYjc`zm|NFrE|Kx1*ieBReoZXQ==wHc%h2)8YDv& zcDgf_xSXxtMleCac9}VygniB>yTHLES0TyHdS`UtP|;6tA$Bv27pV#f15Pd0$}fmK z&GwU6*Ar=Jc!Td3-As9Hl|!P-Wc~tl;Rt^4S%pl{2kgd@4nTHlx4(qSq*$u1MEyMh zIEqj;y+c}Y-U06+++U$uw$8{J9Q}yse+G)Qw`y+!( z+ugk?q^3DXwKbGCQ4G#9-On`SSZ7eF2dS~j%)X@!d%L50f6qlX$r>cQa36yvk1z8R ze@`tyvlT_O-cz}y5Vy0s78-Ke^>jq^`BZjCDcKja{?M(l1dN-ny(7R6*;y9?ixWAS zhk$DNXjQcT!@neqdAAtc>4{l3Um zm7XLCiCksT4d0I|M=>M79^4fc{S`H;4AV~BRd>A>=1(=qqZouz3}P7W#&q|pyA@W+ z&@(|K#BYYD2OLHp7|z8AYA(NyTpxFI@t1?vUv^i7jduvA>Vk#A0YO1ql4qyyy|eGG znwc2xNF15lF+VpVud_ONc9CXUpB}JhtL~zkvgtaw3)5$G#%4ZkpWcVmpQy~ACVXA0O&BIDJk;N*V5*cXIdw>KMojftYn$fk#$~ zca>i>gf7O9_Nb13S7J6TZ+1ZCub*2*OoqXfHANq>h#c6ablbHsa~V z$4LOQ+!xfyxJVQQ82bSYA(tVF+IrRh_Yf|ayZVc~Y&Bs&1RLxY|3B#F?CDgphA#LY DV}lI{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/item/clockworkability.png b/src/main/resources/assets/signalindustries/item/clockworkability.png new file mode 100644 index 0000000000000000000000000000000000000000..958f4ef2e6479f813b6534592f0078b2813c2fa0 GIT binary patch literal 478 zcmV<40U`d0P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940dq-2K~y+TrIWEv z!$1s%ePnq|&T-ThM4^yB8 zIFrnL#5fGYrh_z1C$;ea<~yjo&meyD7A4d2q543nbH<8vMdYoJP)Xh z=f|0+EwEw=I6^t7{P_db5tc0gZGkIOQ1c>*a?|Vry{HBDouf87)$wph($ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/item/infernaleye.png b/src/main/resources/assets/signalindustries/item/infernaleye.png new file mode 100644 index 0000000000000000000000000000000000000000..a2d8bbff4932f6a0ae1733b55653625fd4ba8707 GIT binary patch literal 636 zcmV-?0)zdDP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940uf0>K~y+TrIJZ# z6JZp`e=`#&nV5i5QG-}itZ_kb0nb*X_25E#@!&!6;z8)q9z;c|h0&AfB}Wex5wubl zkcbNd2l!8BN{jdp=(p{=$xGvoUvlZG*R>L1>>yzjmL_cj&^E!gXDa3fxD^wIa> z-?nwiL!0o*F05G!Q3IC5V0sSs^91^@-}OYHi*nw)9Jf1z&a5b2h^!N75J|$>lX!1O z(B>TUM}=^NzVqqbc;0&vPh@X8EJ~;39o~Vz(xbHr{pfaiybw5E*%~+)HODHEjdyHE zjX)1}CmEIXSsJo===jF)4NDYddVBBST$8iXKmG{0Eo@i@`_mPYDgjrI%aWBuNihDY zk(||oJ2_5UOEZ0|dU(<$Plv@*5RuC1LG^qB36b;Ns#-a96{reIh0Qn^(gwkvGmUUF z0k<@!r5kRLgioLe+eB)RA={v2uO#_kkk+vy+1Hb+REXn`N{FeyKri}KYSm=9ke2&962O?Yc%0=wGR)6lsH`X$!1C@z(-pO*O< zE%Iix_PaueKtYk1GQtTHcd?1SEmaxi{v!IU6LwapBd9`#%MVl;L?qGs`TyH40PqKC WY}0V(OMkfl0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0p>|WK~y+TwUSLp z8$lGu|1s_^>qq=ZC6cDG1cC-6dJ=;4Q0&25y?7~DN^hZ1!IP!p$3?t&5>!MG6g-Gm zDTN+N5rUV3v6LQk%@+lWCTjW+ea9~b@ecKLqPaerbU?nWp$HEk-m%t9emV00b_(i{l@L&c~T1Aci7!^&FbXUc* zw;Eo>5_rGl2lgz6!~>Y$DSL$b@OG-e%coF6e#rU(>>tHClN4wW#yK%x#g#<`yOe#> z$IG@=vdUNob1-XZdkx5>TxfN=q1Vgk3|?X416A>jlU4wkfBBu&eK%@1G}L^K!{#xt zGvY(_LJZ2#Z>Wlaw65T&k$NzCqX)J=;jo5P$#LZ7FEF$0#O!J_9=UQzzG+9aJAhNa zjC{5L_kqHWbBPK_$4?~a8&yyv2Id_e3`bJpg}OtKF3#XQ$s)BWqv_PZrNpi%Bo0}c z3VC>Aig4_;*ZkS&Ky>Svxp-cAhEH)1#uL#JSE_)Cfu+o(jCRH0;@Xctb@Zht_*YFg fx83@U|AT;Q_1CB$OpKSC00000NkvXXu0mjf(#i`W literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/item/signalum_drill.png b/src/main/resources/assets/signalindustries/item/signalum_drill.png new file mode 100644 index 0000000000000000000000000000000000000000..c8894d4ba100d8cdb5855f4ee4c5064b1c02549d GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Li00G|-odIkmq1B3qz4CfdacI?=3R5|>otkM7f{~H<_7A#oc;NWmdQ0_ky z)BE@DU%h(ukAdOJl`Au6&V2j!ZBtXzrAwD?-n{wX!GjgcmtR}B@bU8H%?%BoK7D$y zZQCmwo5va&57pIw{``67%$ZrUX5G7Y?>{f^(W6I!HhVtnZ3j~7B|(0{K)Z+l49#KF zZvwS&7I;J!GcfQS0%1l`4X*~EV2h`VV~9p@?Ae<_O$Iy;7hNuH%Lv@Y5GAtx&wuq< z3bJb}cdHw7ez?DcVFJS;Eyg2TMGC} d`@#B5{!Vcj!&wdUz60IE;OXk;vd$@?2>_g1$g2PV literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/item/signalum_drill_awakened.png b/src/main/resources/assets/signalindustries/item/signalum_drill_awakened.png new file mode 100644 index 0000000000000000000000000000000000000000..4b31789e15d1498e16631f959d99b492d7d819a6 GIT binary patch literal 464 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%LiC0G|-oC9%>og2jQn<+<|zH<*9BWUHZ}@qZTYY*+ci`JxsU7DftI;jZzK zk&zi08T)2({h!8UVq&7Cq@=2mX?;C zo!yoghA$f!4CE|LmF@m!F>H=z(9_dXS68>Qws3ZKR#sLvFfcGOGSb%8R#Q_0y1{AN zIgl6hOM?7@|C0n5qLx~G2WsUk@Q5sCVBk9h!i=ICUJXFOiJmTwAsWH4=Uxgm8Stz;gf|!`{Chk7q@T#&vjSH#7&wlt;y<7=L0I@acQQ*hFvm{0dNFm|w}M5FYEC}> z@@k=C)~VaE_PgpuY`K+qH{G@8`BHUVK95KE-j)mUi}bg$D=zV#r5p!z9D}E;pUXO@ GgeCw+n7En% literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/item/signalum_drill_reinforced.png b/src/main/resources/assets/signalindustries/item/signalum_drill_reinforced.png new file mode 100644 index 0000000000000000000000000000000000000000..284aaf1c4bc445dbc3555e7c56694ba9ac8282b3 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Lig0G|-odLV;=;XebzIiMyDjibupKV^+9EG!xt8Wt>A;NakJN>J`U6O)OF ziIS3%s;cTg1_nn*M_XH4J3G6|%F6uo^z!U%7bhnzEiE-QH60xtJv}{jb@lM@aA#*{ zWo2ap0|O%?BW-Q%|Gd0Fi;^`@y#rFJB|(0{|A_z$_UE1aff_gqJR*x382Ao>Fr%o3 zR|8P6&C|s(L?bx%+-tr=3OsEO%N89<2|nU`VQ1x!cmJhybySl6@AaR&tY!bo#uZG< zmN7l+6>*$;=iLn9H=8$@y>*N_Q1*9Y`rWL_R(CBl({FZ&G;BViw3GGRKck*-Klbo| zgTcm=dRg;0czLhg<@P!7M1FG=mksj*n>WAu8RFhcq(8WPQtj}2hWNu=Qa1XhQyu|b O#Ng@b=d#Wzp$P!dBcF-@ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/misc/bloodmooncolorizer.png b/src/main/resources/assets/signalindustries/misc/blood_moon_colorizer.png similarity index 100% rename from src/main/resources/assets/signalindustries/misc/bloodmooncolorizer.png rename to src/main/resources/assets/signalindustries/misc/blood_moon_colorizer.png diff --git a/src/main/resources/assets/signalindustries/mob/infernal.png b/src/main/resources/assets/signalindustries/mob/infernal.png new file mode 100644 index 0000000000000000000000000000000000000000..132b2b50a6043f7125f255ecb4cb4113c1497e23 GIT binary patch literal 2574 zcmV+p3i0)cP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D38P6wK~!i%)md9i zT*n#ycXPljw*?Fi7-9z(B1mf>#Ft=WY(jA2NKqfED!x>$tTt+;Dyr00?L!}0sc&th zrfSuyZ&9jLa;sK-XrYdUL6F$4laN3i7uyL74K`~7hUK!$Wo`O>|D1v4y4xz!I-fM0 zIcMhVneV^P;E_03{BF*o+?yB4ED%`;i=?EBJd`5Q+aHPZaGA&#{32IEB74y9xFpi> zq(uJSCcgabBKH==^Rtn--$*9B?sa2i=8J5}P|`|10k#!Oh=P zLO>(pIo|u(wg3k+qV2s(M%`cwG*6IxZIMV9#weWC;QaNTKVXRO0tIE_}3=WE9LHqkF#YqL(obBRsM0~k; z7KT9XFSwIqkc!|4;XUYxp9Nk{S#-N1O${Pv+a!7)u5qkMqOEP>)Vm~o5C$z_9>MP- z0wM$F6k@<{<9{QWh;IQ5dL*_7{@e*SfL0eE0J+d>tl=`O%!U7#!sjpC5?>LXkApA}nOzWHx*HHl+?OLVH)G;M z6t`)3Hx?LY-0)@LIyE6F5Is|==a=E6T8P)l+b+=%BKAI$vz=#Q=H=+*?NpKyf{**l z#MfA<#g76)(L%>>T67-sm=S39h!rHKf@9VovN10*p)q4Jge&5Q3cU*RlMJuSLE|)K zn)$&>iL`cth+iUi1`UyPX!act$GDS$zDp`HdP@beR1q@eX`wVBPIH~HpgPnK6a>Ne zaiGflCM~N5MU&%NP!i##MiiGm#)2}$cMJ}^2*ediF zWNJ|OJUbH_+6N+~XaeHUn3{Vbga(C^yb6FCMRt(teB&AfV+CA?mcV$R?lb;x!~$r( z76O39XiP~mJd58+UzGh=P#R2|)f=zxVeufNK$)xN%`w*f9NUY9M-lMe1|h})#tD|j zoM-ETE{rw76=>$XpTYACjJpD+n=xH_ezlO?An0DrLg%>A0ny!994k5A{|l}CqPuWh zKL;Yr^}Mfzut*-ULqU`0J9Hb8=RC$1&L#N}tl&QO5m^v8zsI;(tYa0nm3RpiKrb=J^Dm zg%wjH0U=QPGJ*F$WzYgL9y0xMA7XHPHfs?76%x-ugl7!!GH1qzo)%#vr0-Dk!^jA! zi3u+rNIDiX_e6eB^8b-1JlWaV>hrU+vyzsUCR?{|)d7pKv9YBwB6d6+4omRcd8*~= zGa`5H+>!F~a`Ae-((%=+Ceo)r3~LyYBd@W(Mkz2pu2+lP++0abT^6k47(0$eS%rz* zzI|J-7Ir@8an9=T;^JbrXVBW(x@k;Mxsl*T2)&#ub7u}p=(Jf-EYi6dqISmyrRQL; zY}>X?1;qs(dHr!ielnosIalWclarH6&62TgH8`i|nE~l}!Nd~#8^ruPQYv77i)g7I zl9s*KwVw!70CV5V*S0Qr1je+r6+v)4WZ^w-f?QZ4DuiGAq~W!S6&kh+wOCEMW$z7X z+5PU)b6BWeW#@znf?Bs@vBC(vFl2-jghE)ECJ1lnhmV>7UI)gpQmKbV1? z9=FTupy+ihhVMcUbODQ4VzK>LYm4nqPfwc;7awsmhl|p`z|HayNHIpOx0IcemahcV z1(#q0Gz9eg#ZuEx0A8)+0RJmD^(x_z^uMy~M?4hO!iRYs;74Pd#s;_mca;Q*u(h1H zCLLe@M4u7%IYHvF#rconJ=QM?q;0QM<%#oLqkC(x>-YC0+I7vn16Z~`dsMqNm<4~HA;Di1 ztRQWXnVBhH8ak%CK;NNVY7InZBlZ{APICtt`=0i7_lOYv#z?f~H;aS440ZTTWaS|MBzg zos0Y`t@#EmVP7G-3oU3letP+cI#02gu zu7NxcV@SRRF^7S<8sB?r2Ly*Q-R?~ug{83mNDynvhyK%RHM&~M{jVaYM^Nce>Z?HQ z|GA`98}WR9voTj!W7X};X8^GR<9m9Df9X=e){sY57ESBHYfX9yZm=V02^MxeheROcy+nPuw)qMc<{-iugAcnS*(SM2_Vzl^~0biEXQ3zZz;@vJPQSn0*0r>95#l~%$lE3prr4oLQM`$XOe z$gV$Ssvv7?Yn5au6q3F^xC6jpQh^_s2}m&%eiQMp0DK1L zQ0?KKCGZSl2{%DRHNupglZqv?&#}MV-F$br#s$y- k2!k6V?hXmw$A`#&0p(uOSD85PxBvhE07*qoM6N<$g0QX74*&oF literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/signalindustries/structures/dimensionalAnchor.nbt b/src/main/resources/assets/signalindustries/structures/dimensionalAnchor.nbt index 5d9b575fca90675ab55b413af2d47f87095b05c5..29f7426c2e1d36ced299a6591b59e68c9ef17a40 100644 GIT binary patch literal 436 zcmV;l0ZaZLiwFP!00000|Am%KQo}F|g=ITzdYaa5f$q6TXJEmCT^GRFI0hVmgES#O zHj(5fr<+V?`bC!BdscTuJL;Y;*UOIl@ffIkd%0d{`~-6E`S~#nLq9%0$FDw+e|;wE zzGxy&HZf!(NaDUGydp>v4>b|m#G_rK$HaLh?j~aV$om!lN2|x-)Uu*PT17^WT{`Y!glraoZ(|NQ%hHH3;oQK&U>n6E(4X=LB#f zwF%%vm-XzW}qQA zt^n?xGNk|kOKb+nBWbP6k<1D}YEhvYtEIH*zX;M@NR=(M(HtZ)eFH~Li7in0?1KZ3IG5qoy~6m literal 535 zcmV+y0_go8iwFP!00000|Fu`kZo)7ST-#KtkoqgAj??E2wLSFI178rD2rPvlVMi@| zSAP#^LP%?yHBl?)l*nS3-SzD3W(Y8Zt4TRkTIy2EWudBr!E>UMA<#HxFj!xAu^;|>!0%TJ^FM-MwUQ}7AOshm^c`kJ}QgT)#xh&FB>6OgXXmU7s{W*9{W%a|k zEEf}UCRm*F~*&l)d|40sTKggtBMV9O~U|C6yUaS>(##bMcjrm0DUwRapmpu z1$GSLY8BxN*-pe&y1Nd9HmDd`!{|BH(imC8=sDTa7}<*GIo;C8w;UQAwnfCq2&d +achievements.page.signalindustries.desc=Achievements for Signal Industries! +achievement.signalindustries.init=Initialization +achievement.signalindustries.init.desc=Your journey begins here! Obtain some Raw Signalum Crystals. +achievement.signalindustries.thePrototype=The Prototype +achievement.signalindustries.thePrototype.desc=Create your first Prototype Machine Core. +achievement.signalindustries.fromWithin=From Within +achievement.signalindustries.thePrototype.desc=Extract Signalum Energy from Raw Signalum Crystals using an Extractor. + key.signalindustries.openSuit=Open Suit -key.signalindustries.activateAbility=Activate Suit Ability \ No newline at end of file +key.signalindustries.activateAbility=Activate Suit Ability +key.signalindustries.switchMode=Switch Mode \ No newline at end of file diff --git a/src/main/resources/lang/signalindustries/pl_PL.lang b/src/main/resources/lang/signalindustries/pl_PL.lang deleted file mode 100644 index 9c26bcd3..00000000 --- a/src/main/resources/lang/signalindustries/pl_PL.lang +++ /dev/null @@ -1,2 +0,0 @@ -item.signalindustries.signalumCrystal.name=Krysztal Sygnalowy -item.signalindustries.signalumCrystal.desc=Krysztal, który może przechowywać [Energię Sygnalu] w swojej sieci. Glówny sposób przechowywania i transportu tej substancji. \ No newline at end of file diff --git a/src/main/resources/signalindustries.mixins.json b/src/main/resources/signalindustries.mixins.json index 1b170fa8..5fa2ea4e 100644 --- a/src/main/resources/signalindustries.mixins.json +++ b/src/main/resources/signalindustries.mixins.json @@ -4,8 +4,10 @@ "package": "sunsetsatellite.signalindustries.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ + "AchievementMixin", "BlockRailMixin", "ChunkDecoratorOverworldMixin", + "EntityArrowMixin", "EntityLivingMixin", "EntityMinecartMixin", "EntityMobMixin", @@ -27,7 +29,6 @@ "SpawnerMobsMixin", "WorldGenLabyrinthMixin", "WorldMixin", - "accessors.GuiBlockOverlayAccessor", "invokers.GuiInvoker" ], "client": [