├── LICENSE - ART.txt ├── LICENSE - CODE.txt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src ├── main │ ├── resources │ │ ├── assets │ │ │ └── redstonearsenal │ │ │ │ ├── textures │ │ │ │ ├── items │ │ │ │ │ ├── material │ │ │ │ │ │ ├── dust_electrum_flux.png.mcmeta │ │ │ │ │ │ ├── plate_flux.png │ │ │ │ │ │ ├── rod_obsidian.png │ │ │ │ │ │ ├── gem_crystal_flux.png │ │ │ │ │ │ ├── dust_electrum_flux.png │ │ │ │ │ │ ├── gear_electrum_flux.png │ │ │ │ │ │ ├── rod_obsidian_flux.png │ │ │ │ │ │ ├── ingot_electrum_flux.png │ │ │ │ │ │ ├── nugget_electrum_flux.png │ │ │ │ │ │ ├── gem_crystal_flux.png.mcmeta │ │ │ │ │ │ ├── gear_electrum_flux.png.mcmeta │ │ │ │ │ │ ├── ingot_electrum_flux.png.mcmeta │ │ │ │ │ │ └── nugget_electrum_flux.png.mcmeta │ │ │ │ │ ├── tool │ │ │ │ │ │ └── flux │ │ │ │ │ │ │ ├── flux_axe.png │ │ │ │ │ │ │ ├── flux_bow.png │ │ │ │ │ │ │ ├── flux_sword.png │ │ │ │ │ │ │ ├── flux_hammer.png │ │ │ │ │ │ │ ├── flux_pickaxe.png │ │ │ │ │ │ │ ├── flux_shield.png │ │ │ │ │ │ │ ├── flux_shovel.png │ │ │ │ │ │ │ ├── flux_sickle.png │ │ │ │ │ │ │ ├── flux_wrench.png │ │ │ │ │ │ │ ├── flux_axe_active.png │ │ │ │ │ │ │ ├── flux_bow_active.png │ │ │ │ │ │ │ ├── flux_bow_active_0.png │ │ │ │ │ │ │ ├── flux_bow_active_1.png │ │ │ │ │ │ │ ├── flux_bow_active_2.png │ │ │ │ │ │ │ ├── flux_fishing_rod.png │ │ │ │ │ │ │ ├── flux_sword_active.png │ │ │ │ │ │ │ ├── flux_axe_empowered.png │ │ │ │ │ │ │ ├── flux_battle_wrench.png │ │ │ │ │ │ │ ├── flux_bow_empowered.png │ │ │ │ │ │ │ ├── flux_bow_empowered_0.png │ │ │ │ │ │ │ ├── flux_bow_empowered_1.png │ │ │ │ │ │ │ ├── flux_bow_empowered_2.png │ │ │ │ │ │ │ ├── flux_hammer_active.png │ │ │ │ │ │ │ ├── flux_pickaxe_active.png │ │ │ │ │ │ │ ├── flux_shield_active.png │ │ │ │ │ │ │ ├── flux_shovel_active.png │ │ │ │ │ │ │ ├── flux_sickle_active.png │ │ │ │ │ │ │ ├── flux_sword_empowered.png │ │ │ │ │ │ │ ├── flux_wrench_active.png │ │ │ │ │ │ │ ├── flux_hammer_empowered.png │ │ │ │ │ │ │ ├── flux_pickaxe_empowered.png │ │ │ │ │ │ │ ├── flux_shield_empowered.png │ │ │ │ │ │ │ ├── flux_shovel_empowered.png │ │ │ │ │ │ │ ├── flux_sickle_empowered.png │ │ │ │ │ │ │ ├── flux_battle_wrench_active.png │ │ │ │ │ │ │ ├── flux_fishing_rod_active.png │ │ │ │ │ │ │ ├── flux_fishing_rod_empowered.png │ │ │ │ │ │ │ ├── flux_battle_wrench_empowered.png │ │ │ │ │ │ │ ├── flux_fishing_rod_active_cast.png │ │ │ │ │ │ │ ├── flux_fishing_rod_empowered_cast.png │ │ │ │ │ │ │ ├── flux_axe_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_bow_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_bow_empowered_0.png.mcmeta │ │ │ │ │ │ │ ├── flux_bow_empowered_1.png.mcmeta │ │ │ │ │ │ │ ├── flux_bow_empowered_2.png.mcmeta │ │ │ │ │ │ │ ├── flux_hammer_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_shovel_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_sickle_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_sword_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_battle_wrench_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_fishing_rod_empowered.png.mcmeta │ │ │ │ │ │ │ ├── flux_fishing_rod_empowered_cast.png.mcmeta │ │ │ │ │ │ │ └── flux_pickaxe_empowered.png.mcmeta │ │ │ │ │ └── armor │ │ │ │ │ │ └── flux │ │ │ │ │ │ ├── flux_boots.png │ │ │ │ │ │ ├── flux_helmet.png │ │ │ │ │ │ ├── flux_leggings.png │ │ │ │ │ │ └── flux_chestplate.png │ │ │ │ ├── logo.png │ │ │ │ ├── armor │ │ │ │ │ ├── flux_1.png │ │ │ │ │ └── flux_2.png │ │ │ │ └── blocks │ │ │ │ │ └── storage │ │ │ │ │ ├── crystal_flux.png │ │ │ │ │ ├── electrum_flux.png │ │ │ │ │ ├── crystal_flux.png.mcmeta │ │ │ │ │ └── electrum_flux.png.mcmeta │ │ │ │ ├── models │ │ │ │ └── item │ │ │ │ │ ├── armor │ │ │ │ │ └── flux │ │ │ │ │ │ ├── flux_boots.json │ │ │ │ │ │ ├── flux_helmet.json │ │ │ │ │ │ ├── flux_chestplate.json │ │ │ │ │ │ └── flux_leggings.json │ │ │ │ │ └── tool │ │ │ │ │ ├── flux │ │ │ │ │ ├── flux_axe_active.json │ │ │ │ │ ├── flux_bow_active.json │ │ │ │ │ ├── flux_shield_blocking.json │ │ │ │ │ ├── flux_axe_empowered.json │ │ │ │ │ ├── flux_bow_active_0.json │ │ │ │ │ ├── flux_bow_active_1.json │ │ │ │ │ ├── flux_bow_active_2.json │ │ │ │ │ ├── flux_bow_empowered.json │ │ │ │ │ ├── flux_shield_active.json │ │ │ │ │ ├── flux_shovel_active.json │ │ │ │ │ ├── flux_sickle_active.json │ │ │ │ │ ├── flux_sword_active.json │ │ │ │ │ ├── flux_bow_empowered_0.json │ │ │ │ │ ├── flux_bow_empowered_1.json │ │ │ │ │ ├── flux_bow_empowered_2.json │ │ │ │ │ ├── flux_hammer_active.json │ │ │ │ │ ├── flux_pickaxe_active.json │ │ │ │ │ ├── flux_shovel_empowered.json │ │ │ │ │ ├── flux_sword_empowered.json │ │ │ │ │ ├── flux_wrench_active.json │ │ │ │ │ ├── flux_hammer_empowered.json │ │ │ │ │ ├── flux_shield_empowered.json │ │ │ │ │ ├── flux_sickle_empowered.json │ │ │ │ │ ├── flux_pickaxe_empowered.json │ │ │ │ │ ├── flux_fishing_rod_active.json │ │ │ │ │ ├── flux_fishing_rod_empowered.json │ │ │ │ │ ├── flux_shield_active_blocking.json │ │ │ │ │ ├── flux_battle_wrench_active.json │ │ │ │ │ ├── flux_shield_empowered_blocking.json │ │ │ │ │ ├── flux_battle_wrench_empowered.json │ │ │ │ │ ├── flux_fishing_rod_active_cast.json │ │ │ │ │ ├── flux_fishing_rod_empowered_cast.json │ │ │ │ │ ├── flux_wrench.json │ │ │ │ │ ├── flux_axe.json │ │ │ │ │ ├── flux_sword.json │ │ │ │ │ ├── flux_hammer.json │ │ │ │ │ ├── flux_pickaxe.json │ │ │ │ │ ├── flux_shovel.json │ │ │ │ │ ├── flux_sickle.json │ │ │ │ │ ├── flux_battle_wrench.json │ │ │ │ │ ├── flux_shield.json │ │ │ │ │ ├── flux_fishing_rod.json │ │ │ │ │ └── flux_bow.json │ │ │ │ │ ├── shield.json │ │ │ │ │ └── shield_blocking.json │ │ │ │ ├── blockstates │ │ │ │ ├── storage.json │ │ │ │ └── material.json │ │ │ │ └── lang │ │ │ │ ├── fr_FR.lang │ │ │ │ ├── es_ES.lang │ │ │ │ ├── zh_TW.lang │ │ │ │ ├── ko_KR.lang │ │ │ │ ├── zh_CN.lang │ │ │ │ ├── sk_SK.lang │ │ │ │ ├── it_IT.lang │ │ │ │ ├── pt_BR.lang │ │ │ │ ├── ru_RU.lang │ │ │ │ ├── en_US.lang │ │ │ │ └── de_DE.lang │ │ ├── mcmod.info │ │ └── cofh_at.cfg │ └── java │ │ └── cofh │ │ └── redstonearsenal │ │ ├── proxy │ │ ├── Proxy.java │ │ └── ProxyClient.java │ │ ├── gui │ │ ├── GuiConfigRAFactory.java │ │ ├── GuiConfigRA.java │ │ └── CreativeTabRA.java │ │ ├── block │ │ ├── ItemBlockStorage.java │ │ └── BlockStorage.java │ │ ├── init │ │ ├── RAItems.java │ │ ├── RABlocks.java │ │ └── RAProps.java │ │ ├── item │ │ ├── tool │ │ │ ├── ItemAxeRF.java │ │ │ ├── ItemSickleRF.java │ │ │ ├── ItemHammerRF.java │ │ │ ├── ItemPickaxeRF.java │ │ │ ├── ItemBattleWrenchRF.java │ │ │ ├── ItemBowRF.java │ │ │ ├── ItemShovelRF.java │ │ │ ├── ItemFishingRodRF.java │ │ │ ├── ItemShieldRF.java │ │ │ ├── ItemSwordRF.java │ │ │ └── ItemToolRF.java │ │ ├── ItemMaterial.java │ │ └── armor │ │ │ └── ItemArmorRF.java │ │ └── RedstoneArsenal.java └── api │ └── java │ └── ic2 │ └── api │ └── tile │ └── IWrenchable.java ├── gradlew.bat ├── README.md ├── .gitignore └── gradlew /LICENSE - ART.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/LICENSE - ART.txt -------------------------------------------------------------------------------- /LICENSE - CODE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/LICENSE - CODE.txt -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/dust_electrum_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 1 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/armor/flux_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/armor/flux_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/armor/flux_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/armor/flux_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/armor/flux/flux_boots.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/armor/flux/flux_boots" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/armor/flux/flux_helmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/armor/flux/flux_helmet" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/armor/flux/flux_chestplate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/armor/flux/flux_chestplate" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/armor/flux/flux_leggings.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/armor/flux/flux_leggings" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/plate_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/plate_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/blocks/storage/crystal_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/blocks/storage/crystal_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/blocks/storage/electrum_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/blocks/storage/electrum_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_boots.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_helmet.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/rod_obsidian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/rod_obsidian.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_wrench.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_leggings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_leggings.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/gem_crystal_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/gem_crystal_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_chestplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/armor/flux/flux_chestplate.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/dust_electrum_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/dust_electrum_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/gear_electrum_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/gear_electrum_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/rod_obsidian_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/rod_obsidian_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_0.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_active_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_axe_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_axe", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_axe_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield_blocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/shield_blocking", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/ingot_electrum_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/ingot_electrum_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/nugget_electrum_flux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/material/nugget_electrum_flux.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_0.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_wrench_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_wrench_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_axe_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_axe", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_axe_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_active_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_active_0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_active_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_active_1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_active_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_active_2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/flux/flux_shield", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shovel_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_shovel", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_shovel_active" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sickle_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_sickle", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sickle_active" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sword_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_sword", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sword_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shield_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_empowered_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_empowered_0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_empowered_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_empowered_1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow_empowered_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_bow", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow_empowered_2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_hammer_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_hammer", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_hammer_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_pickaxe_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_pickaxe", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_pickaxe_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shovel_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_shovel", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_shovel_empowered" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sword_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_sword", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sword_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_wrench_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_wrench", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_wrench_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_active.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_hammer_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_hammer", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_hammer_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/flux/flux_shield", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sickle_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_sickle", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sickle_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_pickaxe_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_pickaxe", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_pickaxe_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench_empowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench_empowered.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_active_cast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_active_cast.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_fishing_rod_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_fishing_rod", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_fishing_rod_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_fishing_rod_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_fishing_rod", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_fishing_rod_empowered" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield_active_blocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/flux/flux_shield_blocking", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered_cast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheCBProject/RedstoneArsenal/master/src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered_cast.png -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_battle_wrench_active.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_battle_wrench", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_battle_wrench_active" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield_empowered_blocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/flux/flux_shield_blocking", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_battle_wrench_empowered.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_battle_wrench", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_battle_wrench_empowered" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_fishing_rod_active_cast.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_fishing_rod", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_fishing_rod_active_cast" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_fishing_rod_empowered_cast.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "redstonearsenal:item/tool/flux/flux_fishing_rod", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_fishing_rod_empowered_cast" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Sep 07 14:31:39 EDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_axe_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_0.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_1.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_bow_empowered_2.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_hammer_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_shovel_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sickle_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_sword_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_battle_wrench_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_fishing_rod_empowered_cast.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_wrench" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_wrench_active" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/tool/flux/flux_pickaxe_empowered.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "interpolate": true, 5 | "frames": [ 6 | 0, 7 | 1, 8 | 2, 9 | 3, 10 | 4, 11 | 5, 12 | 6, 13 | 7, 14 | 6, 15 | 5, 16 | 4, 17 | 3, 18 | 2, 19 | 1 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/blockstates/storage.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "cube_all", 5 | "transform": "forge:default-block" 6 | }, 7 | "variants": { 8 | "type": { 9 | "electrumflux": { 10 | "textures": { 11 | "all": "redstonearsenal:blocks/storage/electrum_flux" 12 | } 13 | }, 14 | "crystalflux": { 15 | "textures": { 16 | "all": "redstonearsenal:blocks/storage/crystal_flux" 17 | } 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_axe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_axe" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_axe_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_axe_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sword" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_sword_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_sword_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_hammer.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_hammer" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_hammer_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_hammer_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_pickaxe" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_pickaxe_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_pickaxe_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shovel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_shovel" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_shovel_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_shovel_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_sickle.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_sickle" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_sickle_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_sickle_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_battle_wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_battle_wrench" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_battle_wrench_active" 12 | }, 13 | { 14 | "predicate": { 15 | "empowered": 1.0 16 | }, 17 | "model": "redstonearsenal:item/tool/flux/flux_battle_wrench_empowered" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "redstonearsenal", 4 | "name": "Redstone Arsenal", 5 | "description": "Behold the Redstone (Flux) Revolution - provides Flux-Infused Tools and Armor!", 6 | "version": "${version}", 7 | "credits": "Team CoFH", 8 | "logoFile": "assets/redstonearsenal/textures/logo.png", 9 | "mcversion": "${mc_version}", 10 | "url": "http://www.teamcofh.com", 11 | "updateUrl": "", 12 | "authorList": [ "Team CoFH" ], 13 | "parent": "", 14 | "screenshots": [], 15 | "dependencies": [ 16 | "Forge,cofhcore" 17 | ] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/gem_crystal_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/gear_electrum_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/ingot_electrum_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/items/material/nugget_electrum_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/blocks/storage/crystal_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/textures/blocks/storage/electrum_flux.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/proxy/Proxy.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.proxy; 2 | 3 | import cofh.core.render.IModelRegister; 4 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 5 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 6 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 7 | 8 | public class Proxy { 9 | 10 | /* INIT */ 11 | public void preInit(FMLPreInitializationEvent event) { 12 | 13 | } 14 | 15 | public void initialize(FMLInitializationEvent event) { 16 | 17 | } 18 | 19 | public void postInit(FMLPostInitializationEvent event) { 20 | 21 | } 22 | 23 | /* HELPERS */ 24 | public boolean addIModelRegister(IModelRegister modelRegister) { 25 | 26 | return false; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/fr_FR.lang: -------------------------------------------------------------------------------- 1 | #fr_FR 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF par Utilisation 4 | info.redstonearsenal.tool.shovel=Sert aussi de Houe. 5 | info.redstonearsenal.tool.wrench=Remplace aussi les Cisailles. 6 | 7 | item.redstonearsenal.material.dustElectrumFlux.name=Mélange d'Électrum Fluxé 8 | item.redstonearsenal.material.gemCrystalFlux.name=Cristal de Flux 9 | item.redstonearsenal.material.ingotElectrumFlux.name=Lingot d'Électrum Fluxé 10 | item.redstonearsenal.material.nuggetElectrumFlux.name=Pépite d'Électrum Fluxé 11 | item.redstonearsenal.material.rodObsidian.name=Bâton d'Obsidienne 12 | item.redstonearsenal.material.rodObsidianFlux.name=Bâton d'Obsidienne Imprégné 13 | 14 | tile.redstonearsenal.storage.crystalFlux.name=Bloc de Cristal de Flux 15 | tile.redstonearsenal.storage.electrumFlux.name=Bloc d'Électrum Fluxé 16 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/gui/GuiConfigRAFactory.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.gui; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraftforge.fml.client.IModGuiFactory; 6 | 7 | import java.util.Set; 8 | 9 | public class GuiConfigRAFactory implements IModGuiFactory { 10 | 11 | /* IModGuiFactory */ 12 | @Override 13 | public void initialize(Minecraft minecraftInstance) { 14 | 15 | } 16 | 17 | @Override 18 | public Class mainConfigGuiClass() { 19 | 20 | return GuiConfigRA.class; 21 | } 22 | 23 | @Override 24 | public Set runtimeGuiCategories() { 25 | 26 | return null; 27 | } 28 | 29 | @Override 30 | public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { 31 | 32 | return null; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_shield.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"redstonearsenal:item/tool/shield", 3 | "textures": { 4 | "layer0":"redstonearsenal:items/tool/flux/flux_shield" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_shield_active" 12 | }, 13 | { 14 | "predicate": { 15 | "blocking": 1, 16 | "active": 1 17 | }, 18 | "model": "redstonearsenal:item/tool/flux/flux_shield_active_blocking" 19 | }, 20 | { 21 | "predicate": { 22 | "empowered": 1 23 | }, 24 | "model": "redstonearsenal:item/tool/flux/flux_shield_empowered" 25 | }, 26 | { 27 | "predicate": { 28 | "blocking": 1, 29 | "empowered": 1 30 | }, 31 | "model": "redstonearsenal:item/tool/flux/flux_shield_empowered_blocking" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_fishing_rod.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/handheld_rod", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_fishing_rod" 5 | }, 6 | "overrides": [ 7 | { 8 | "predicate": { 9 | "active": 1.0 10 | }, 11 | "model": "redstonearsenal:item/tool/flux/flux_fishing_rod_active" 12 | }, 13 | { 14 | "predicate": { 15 | "cast": 1.0, 16 | "active": 1.0 17 | }, 18 | "model": "redstonearsenal:item/tool/flux/flux_fishing_rod_active_cast" 19 | }, 20 | { 21 | "predicate": { 22 | "empowered": 1.0 23 | }, 24 | "model": "redstonearsenal:item/tool/flux/flux_fishing_rod_empowered" 25 | }, 26 | { 27 | "predicate": { 28 | "cast": 1.0, 29 | "empowered": 1.0 30 | }, 31 | "model": "redstonearsenal:item/tool/flux/flux_fishing_rod_empowered_cast" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/block/ItemBlockStorage.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.block; 2 | 3 | import cofh.core.block.ItemBlockCore; 4 | import cofh.lib.util.helpers.ItemHelper; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.item.EnumRarity; 7 | import net.minecraft.item.ItemStack; 8 | 9 | public class ItemBlockStorage extends ItemBlockCore { 10 | 11 | public ItemBlockStorage(Block block) { 12 | 13 | super(block); 14 | setHasSubtypes(true); 15 | setMaxDamage(0); 16 | } 17 | 18 | @Override 19 | public String getUnlocalizedName(ItemStack stack) { 20 | 21 | return "tile.redstonearsenal.storage." + BlockStorage.Type.byMetadata(ItemHelper.getItemDamage(stack)).getNameRaw() + ".name"; 22 | } 23 | 24 | @Override 25 | public EnumRarity getRarity(ItemStack stack) { 26 | 27 | return BlockStorage.Type.byMetadata(ItemHelper.getItemDamage(stack)).getRarity(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/es_ES.lang: -------------------------------------------------------------------------------- 1 | #es_ES 2 | 3 | info.redstonearsenal.tool.energyPerUse=FR por Uso 4 | info.redstonearsenal.tool.shovel=Además sirve como Azada. 5 | info.redstonearsenal.tool.wrench=Además sirve como Tijeras. 6 | 7 | item.redstonearsenal.material.dustElectrumFlux.name=Mixtura de Electro Fluyente 8 | item.redstonearsenal.material.gemCrystalFlux.name=Cristal Fluyente 9 | item.redstonearsenal.material.ingotElectrumFlux.name=Lingote de Electro Fluyente 10 | item.redstonearsenal.material.nuggetElectrumFlux.name=Pepita de Electro Fluyente 11 | item.redstonearsenal.material.rodObsidian.name=Barra de Obsidiana 12 | item.redstonearsenal.material.rodObsidianFlux.name=Barra Infusa de Obsidiana 13 | 14 | itemGroup.redstonearsenal.creativeTab=Arsenal de Redstone 15 | 16 | tile.redstonearsenal.storage.crystalFlux.name=Bloque de Cristal Fluyente 17 | tile.redstonearsenal.storage.electrumFlux.name=Bloque de Electro Fluyente 18 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/init/RAItems.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.init; 2 | 3 | import cofh.core.util.core.IInitializer; 4 | import cofh.redstonearsenal.item.ItemMaterial; 5 | 6 | import java.util.ArrayList; 7 | 8 | public class RAItems { 9 | 10 | private RAItems() { 11 | 12 | } 13 | 14 | public static void preInit() { 15 | 16 | itemMaterial = new ItemMaterial(); 17 | 18 | initList.add(itemMaterial); 19 | 20 | for (int i = 0; i < initList.size(); i++) { 21 | initList.get(i).preInit(); 22 | } 23 | } 24 | 25 | public static void initialize() { 26 | 27 | for (int i = 0; i < initList.size(); i++) { 28 | initList.get(i).initialize(); 29 | } 30 | } 31 | 32 | public static void postInit() { 33 | 34 | for (int i = 0; i < initList.size(); i++) { 35 | initList.get(i).postInit(); 36 | } 37 | initList.clear(); 38 | } 39 | 40 | static ArrayList initList = new ArrayList<>(); 41 | 42 | /* REFERENCES */ 43 | public static ItemMaterial itemMaterial; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/gui/GuiConfigRA.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.gui; 2 | 3 | import cofh.redstonearsenal.RedstoneArsenal; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraftforge.common.config.ConfigElement; 6 | import net.minecraftforge.fml.client.config.GuiConfig; 7 | import net.minecraftforge.fml.client.config.IConfigElement; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | public class GuiConfigRA extends GuiConfig { 13 | 14 | public GuiConfigRA(GuiScreen parentScreen) { 15 | 16 | super(parentScreen, getConfigElements(parentScreen), RedstoneArsenal.MOD_ID, false, false, RedstoneArsenal.MOD_NAME); 17 | } 18 | 19 | public static final String[] CATEGORIES = { "Equipment", "Storage" }; 20 | 21 | private static List getConfigElements(GuiScreen parent) { 22 | 23 | List list = new ArrayList<>(); 24 | 25 | for (String element : CATEGORIES) { 26 | list.add(new ConfigElement(RedstoneArsenal.CONFIG.getCategory(element))); 27 | } 28 | return list; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/init/RABlocks.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.init; 2 | 3 | import cofh.core.util.core.IInitializer; 4 | import cofh.redstonearsenal.RedstoneArsenal; 5 | import cofh.redstonearsenal.block.BlockStorage; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class RABlocks { 10 | 11 | private RABlocks() { 12 | 13 | } 14 | 15 | public static void preInit() { 16 | 17 | blockStorage = new BlockStorage(); 18 | 19 | initList.add(blockStorage); 20 | 21 | RedstoneArsenal.proxy.addIModelRegister(blockStorage); 22 | 23 | for (int i = 0; i < initList.size(); i++) { 24 | initList.get(i).preInit(); 25 | } 26 | } 27 | 28 | public static void initialize() { 29 | 30 | for (int i = 0; i < initList.size(); i++) { 31 | initList.get(i).initialize(); 32 | } 33 | } 34 | 35 | public static void postInit() { 36 | 37 | for (int i = 0; i < initList.size(); i++) { 38 | initList.get(i).postInit(); 39 | } 40 | initList.clear(); 41 | } 42 | 43 | static ArrayList initList = new ArrayList<>(); 44 | 45 | /* REFERENCES */ 46 | public static BlockStorage blockStorage; 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/proxy/ProxyClient.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.proxy; 2 | 3 | import cofh.core.render.IModelRegister; 4 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 5 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 6 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class ProxyClient extends Proxy { 11 | 12 | /* INIT */ 13 | @Override 14 | public void preInit(FMLPreInitializationEvent event) { 15 | 16 | super.preInit(event); 17 | 18 | for (int i = 0; i < modelList.size(); i++) { 19 | modelList.get(i).registerModels(); 20 | } 21 | } 22 | 23 | @Override 24 | public void initialize(FMLInitializationEvent event) { 25 | 26 | super.initialize(event); 27 | } 28 | 29 | @Override 30 | public void postInit(FMLPostInitializationEvent event) { 31 | 32 | super.postInit(event); 33 | } 34 | 35 | /* HELPERS */ 36 | public boolean addIModelRegister(IModelRegister modelRegister) { 37 | 38 | return modelList.add(modelRegister); 39 | } 40 | 41 | private static ArrayList modelList = new ArrayList<>(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/gui/CreativeTabRA.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.gui; 2 | 3 | import cofh.redstonearsenal.init.RAEquipment; 4 | import net.minecraft.creativetab.CreativeTabs; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.nbt.NBTTagCompound; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | import net.minecraftforge.fml.relauncher.SideOnly; 10 | 11 | public class CreativeTabRA extends CreativeTabs { 12 | 13 | public CreativeTabRA() { 14 | 15 | super("RedstoneArsenal"); 16 | } 17 | 18 | @Override 19 | @SideOnly (Side.CLIENT) 20 | public ItemStack getIconItemStack() { 21 | 22 | ItemStack iconStack = new ItemStack(RAEquipment.ToolSet.FLUX.itemSword); 23 | iconStack.setTagCompound(new NBTTagCompound()); 24 | iconStack.getTagCompound().setBoolean("CreativeTab", true); 25 | iconStack.getTagCompound().setInteger("Energy", 32000); 26 | iconStack.getTagCompound().setInteger("Mode", 1); 27 | 28 | return iconStack; 29 | } 30 | 31 | @Override 32 | @SideOnly (Side.CLIENT) 33 | public Item getTabIconItem() { 34 | 35 | return getIconItemStack().getItem(); 36 | } 37 | 38 | @Override 39 | @SideOnly (Side.CLIENT) 40 | public String getTabLabel() { 41 | 42 | return "redstonearsenal.creativeTab"; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/shield.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"builtin/generated", 3 | "display": { 4 | "thirdperson_righthand": { 5 | "rotation": [ 60, 320, 0 ], 6 | "translation": [ 0.50, 1.00, 0.00 ], 7 | "scale": [ 1.00, 1.00, 1.00 ] 8 | }, 9 | "thirdperson_lefthand": { 10 | "rotation": [ 60, 320, 0 ], 11 | "translation": [ 0.50, 1.00, 0.00 ], 12 | "scale": [ 1.00, 1.00, 1.00 ] 13 | }, 14 | "firstperson_righthand": { 15 | "rotation": [ 0, 0, 0 ], 16 | "translation": [ 1.00, -2.00, 0.00 ], 17 | "scale": [ 1.00, 1.00, 1.00 ] 18 | }, 19 | "firstperson_lefthand": { 20 | "rotation": [ 0, 0, 0 ], 21 | "translation": [ 1.00, -2.00, 0.00 ], 22 | "scale": [ 1.00, 1.00, 1.00 ] 23 | }, 24 | "gui": { 25 | "rotation": [ 0, 0, 0 ], 26 | "translation": [ 0.00, 0.00, 0.00 ], 27 | "scale": [ 1.00, 1.00, 1.00 ] 28 | }, 29 | "head": { 30 | "rotation": [ 0, 0, 0 ], 31 | "translation": [ 0.00, 0.00, 0.00 ], 32 | "scale": [ 1.00, 1.00, 1.00 ] 33 | }, 34 | "fixed": { 35 | "rotation": [ 0, 0, 0 ], 36 | "translation": [ 0.00, 0.00, 0.00 ], 37 | "scale": [ 1.00, 1.00, 1.00 ] 38 | }, 39 | "ground": { 40 | "rotation": [ 0, 0, 0 ], 41 | "translation": [ 0.00, 3.00, 0.00 ], 42 | "scale": [ 0.75, 0.75, 0.75 ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/shield_blocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent":"builtin/generated", 3 | "display": { 4 | "thirdperson_righthand": { 5 | "rotation": [ 40, 330, 0 ], 6 | "translation": [ 0.00, 0.00, -1.00 ], 7 | "scale": [ 1.00, 1.00, 1.00 ] 8 | }, 9 | "thirdperson_lefthand": { 10 | "rotation": [ 40, 330, 0 ], 11 | "translation": [ 0.00, 0.00, -1.00 ], 12 | "scale": [ 1.00, 1.00, 1.00 ] 13 | }, 14 | "firstperson_righthand": { 15 | "rotation": [ 0, 0, 20 ], 16 | "translation": [ -6.00, 2.00, 0.00 ], 17 | "scale": [ 1.00, 1.00, 1.00 ] 18 | }, 19 | "firstperson_lefthand": { 20 | "rotation": [ 0, 0, 20 ], 21 | "translation": [ -6.00, 2.00, 0.00 ], 22 | "scale": [ 1.00, 1.00, 1.00 ] 23 | }, 24 | "gui": { 25 | "rotation": [ 0, 0, 0 ], 26 | "translation": [ 0.00, 0.00, 0.00 ], 27 | "scale": [ 1.00, 1.00, 1.00 ] 28 | }, 29 | "head": { 30 | "rotation": [ 0, 0, 0 ], 31 | "translation": [ 0.00, 0.00, 0.00 ], 32 | "scale": [ 1.00, 1.00, 1.00 ] 33 | }, 34 | "fixed": { 35 | "rotation": [ 0, 0, 0 ], 36 | "translation": [ 0.00, 0.00, 0.00 ], 37 | "scale": [ 1.00, 1.00, 1.00 ] 38 | }, 39 | "ground": { 40 | "rotation": [ 0, 0, 0 ], 41 | "translation": [ 0.00, 3.00, 0.00 ], 42 | "scale": [ 0.75, 0.75, 0.75 ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/blockstates/material.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "builtin/generated", 5 | "textures": { 6 | "layer0": "blocks/dirt" 7 | }, 8 | "transform": "forge:default-item" 9 | }, 10 | "variants": { 11 | "type": { 12 | "dustelectrumflux": { 13 | "textures": { 14 | "layer0": "redstonearsenal:items/material/dust_electrum_flux" 15 | } 16 | }, 17 | "ingotelectrumflux": { 18 | "textures": { 19 | "layer0": "redstonearsenal:items/material/ingot_electrum_flux" 20 | } 21 | }, 22 | "nuggetelectrumflux": { 23 | "textures": { 24 | "layer0": "redstonearsenal:items/material/nugget_electrum_flux" 25 | } 26 | }, 27 | "gearelectrumflux": { 28 | "textures": { 29 | "layer0": "redstonearsenal:items/material/gear_electrum_flux" 30 | } 31 | }, 32 | "gemcrystalflux": { 33 | "textures": { 34 | "layer0": "redstonearsenal:items/material/gem_crystal_flux" 35 | } 36 | }, 37 | "plateflux": { 38 | "textures": { 39 | "layer0": "redstonearsenal:items/material/plate_flux" 40 | } 41 | }, 42 | "rodobsidian": { 43 | "textures": { 44 | "layer0": "redstonearsenal:items/material/rod_obsidian" 45 | } 46 | }, 47 | "rodobsidianflux": { 48 | "textures": { 49 | "layer0": "redstonearsenal:items/material/rod_obsidian_flux" 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/init/RAProps.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.init; 2 | 3 | import cofh.api.item.IMultiModeItem; 4 | import cofh.core.key.KeyBindingItemMultiMode; 5 | import cofh.lib.util.helpers.StringHelper; 6 | import cofh.redstonearsenal.RedstoneArsenal; 7 | import cofh.redstonearsenal.gui.CreativeTabRA; 8 | import net.minecraft.item.ItemStack; 9 | 10 | import java.util.List; 11 | 12 | public class RAProps { 13 | 14 | private RAProps() { 15 | 16 | } 17 | 18 | public static void preInit() { 19 | 20 | configCommon(); 21 | configClient(); 22 | } 23 | 24 | public static void loadComplete() { 25 | 26 | } 27 | 28 | /* HELPERS */ 29 | private static void configCommon() { 30 | 31 | } 32 | 33 | private static void configClient() { 34 | 35 | /* CREATIVE TABS */ 36 | RedstoneArsenal.tabCommon = new CreativeTabRA(); 37 | } 38 | 39 | public static void addEmpoweredTip(IMultiModeItem item, ItemStack stack, List tooltip) { 40 | 41 | if (item.getMode(stack) == 1) { 42 | tooltip.add(StringHelper.localizeFormat("info.redstonearsenal.tool.chargeOff", StringHelper.getKeyName(KeyBindingItemMultiMode.instance.getKey()))); 43 | } else { 44 | tooltip.add(StringHelper.localizeFormat("info.redstonearsenal.tool.chargeOn", StringHelper.getKeyName(KeyBindingItemMultiMode.instance.getKey()))); 45 | } 46 | } 47 | 48 | /* INTERFACE */ 49 | public static boolean showArmorCharge = true; 50 | public static boolean showToolCharge = true; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/zh_TW.lang: -------------------------------------------------------------------------------- 1 | #zh_TW 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF/次使用 4 | info.redstonearsenal.tool.shovel=具有鋤頭的功能 5 | info.redstonearsenal.tool.wrench=具有剪刀的功能 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=充能紅石靴子 8 | item.redstonearsenal.armor.fluxHelmet.name=充能紅石頭盔 9 | item.redstonearsenal.armor.fluxLegs.name=充能紅石護腿 10 | item.redstonearsenal.armor.fluxPlate.name=充能紅石胸甲 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=紅石琥珀金粉 13 | item.redstonearsenal.material.gemCrystalFlux.name=紅石水晶 14 | item.redstonearsenal.material.ingotElectrumFlux.name=紅石琥珀金錠 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=紅石琥珀金粒 16 | item.redstonearsenal.material.plateFlux.name=紅石裝甲防護板 17 | item.redstonearsenal.material.rodObsidian.name=黑曜石手柄 18 | item.redstonearsenal.material.rodObsidianFlux.name=充能黑曜石手柄 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=充能紅石斧 21 | item.redstonearsenal.tool.fluxBattleWrench.name=充能紅石戰鬥板手 22 | item.redstonearsenal.tool.fluxBow.name=充能紅石弓 23 | item.redstonearsenal.tool.fluxFishingRod.name=充能紅石釣魚竿 24 | item.redstonearsenal.tool.fluxPickaxe.name=充能紅石鎬 25 | item.redstonearsenal.tool.fluxShovel.name=充能紅石鏟 26 | item.redstonearsenal.tool.fluxSickle.name=充能紅石鐮刀 27 | item.redstonearsenal.tool.fluxSword.name=充能紅石劍 28 | item.redstonearsenal.tool.fluxWrench.name=充能紅石板手 29 | 30 | itemGroup.redstonearsenal.creativeTab=紅石兵工廠 31 | 32 | tile.redstonearsenal.storage.crystalFlux.name=紅石水晶塊 33 | tile.redstonearsenal.storage.electrumFlux.name=紅石琥珀金塊 34 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/ko_KR.lang: -------------------------------------------------------------------------------- 1 | #ko_KR 2 | 3 | info.redstonearsenal.tool.energyPerUse=1회당 사용 RF 4 | info.redstonearsenal.tool.shovel=괭이겸용 5 | info.redstonearsenal.tool.wrench=가위겸용 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=플럭스가 주입된 부츠 8 | item.redstonearsenal.armor.fluxHelmet.name=플럭스가 주입된 핼멧 9 | item.redstonearsenal.armor.fluxLegs.name=플럭스가 주입된 레깅스 10 | item.redstonearsenal.armor.fluxPlate.name=플럭스가 주입된 갑옷 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=플럭스 일렉트럼 가루 13 | item.redstonearsenal.material.gemCrystalFlux.name=플럭스 수정 14 | item.redstonearsenal.material.ingotElectrumFlux.name=플럭스 일렉트럼 주괴 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=플럭스 일렉트럼 조각 16 | item.redstonearsenal.material.plateFlux.name=플럭스 장갑판 17 | item.redstonearsenal.material.rodObsidian.name=흑요석 막대 18 | item.redstonearsenal.material.rodObsidianFlux.name=주입된 흑요석 막대 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=플럭스가 주입된 도끼 21 | item.redstonearsenal.tool.fluxBattleWrench.name=플럭스가 주입된 전투렌치 22 | item.redstonearsenal.tool.fluxBow.name=플럭스가 주입된 활 23 | item.redstonearsenal.tool.fluxFishingRod.name=플럭스가 주입된 낚시대 24 | item.redstonearsenal.tool.fluxPickaxe.name=플럭스가 주입된 곡괭이 25 | item.redstonearsenal.tool.fluxShovel.name=플럭스가 주입된 삽 26 | item.redstonearsenal.tool.fluxSickle.name=플럭스가 주입된 낫 27 | item.redstonearsenal.tool.fluxSword.name=플럭스가 주입된 검 28 | item.redstonearsenal.tool.fluxWrench.name=플럭스가 주입된 만능렌치 29 | 30 | itemGroup.redstonearsenal.creativeTab=레드스톤 아스널[Redstone Arsenal] 31 | 32 | tile.redstonearsenal.storage.crystalFlux.name=플럭스 수정 블럭 33 | tile.redstonearsenal.storage.electrumFlux.name=플럭스 일렉트럼 블럭 34 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | #zh_CN 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF/次使用 4 | info.redstonearsenal.tool.shovel=具有锄头的功能 5 | info.redstonearsenal.tool.wrench=具有剪刀的功能 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=红石充能靴子 8 | item.redstonearsenal.armor.fluxHelmet.name=红石充能头盔 9 | item.redstonearsenal.armor.fluxLegs.name=红石充能护腿 10 | item.redstonearsenal.armor.fluxPlate.name=红石充能胸甲 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=红石琥珀金粉末 13 | item.redstonearsenal.material.gearElectrumFlux.name=红石琥珀金齿轮 14 | item.redstonearsenal.material.gemCrystalFlux.name=红石水晶 15 | item.redstonearsenal.material.ingotElectrumFlux.name=红石琥珀金锭 16 | item.redstonearsenal.material.nuggetElectrumFlux.name=红石琥珀金粒 17 | item.redstonearsenal.material.plateFlux.name=红石装甲防护板 18 | item.redstonearsenal.material.rodObsidian.name=黑曜石手柄 19 | item.redstonearsenal.material.rodObsidianFlux.name=充能黑曜石手柄 20 | 21 | item.redstonearsenal.tool.fluxAxe.name=红石充能斧 22 | item.redstonearsenal.tool.fluxBattleWrench.name=红石充能战锤 23 | item.redstonearsenal.tool.fluxBow.name=红石充能弓 24 | item.redstonearsenal.tool.fluxFishingRod.name=红石充能鱼竿 25 | item.redstonearsenal.tool.fluxHammer.name=红石充能锤 26 | item.redstonearsenal.tool.fluxPickaxe.name=红石充能镐 27 | item.redstonearsenal.tool.fluxShovel.name=红石充能锹 28 | item.redstonearsenal.tool.fluxSickle.name=红石充能镰刀 29 | item.redstonearsenal.tool.fluxSword.name=红石充能剑 30 | item.redstonearsenal.tool.fluxWrench.name=红石充能新月锤 31 | 32 | itemGroup.redstonearsenal.creativeTab=红石兵工厂 33 | 34 | tile.redstonearsenal.storage.crystalFlux.name=红石水晶块 35 | tile.redstonearsenal.storage.electrumFlux.name=红石琥珀金块 36 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/sk_SK.lang: -------------------------------------------------------------------------------- 1 | #sk_SK 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF na operáciu 4 | info.redstonearsenal.tool.shovel=Tiež funguje ako motyka. 5 | info.redstonearsenal.tool.wrench=Tiež funguje ako nožnice. 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=Fluxové topánky 8 | item.redstonearsenal.armor.fluxHelmet.name=Fluxová prilba 9 | item.redstonearsenal.armor.fluxLegs.name=Fluxové nohavice 10 | item.redstonearsenal.armor.fluxPlate.name=Fluxové brnenie 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=Zmes fluxového elektra 13 | item.redstonearsenal.material.gemCrystalFlux.name=Fluxový kryštál 14 | item.redstonearsenal.material.ingotElectrumFlux.name=Fluxovo-elektrový ingot 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=Fluxovo-elektrový ingot 16 | item.redstonearsenal.material.plateFlux.name=Fluxové pokovovanie 17 | item.redstonearsenal.material.rodObsidian.name=Obsidiánová tyč 18 | item.redstonearsenal.material.rodObsidianFlux.name=Fluxovo-obsidiánová tyč 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=Fluxová sekera 21 | item.redstonearsenal.tool.fluxBattleWrench.name=Fluxový bojový multi-kľúč 22 | item.redstonearsenal.tool.fluxBow.name=Fluxový luk 23 | item.redstonearsenal.tool.fluxFishingRod.name=Fluxová udica 24 | item.redstonearsenal.tool.fluxPickaxe.name=Fluxový krompáč 25 | item.redstonearsenal.tool.fluxShovel.name=Fluxová lopata 26 | item.redstonearsenal.tool.fluxSickle.name=Fluxový kosák 27 | item.redstonearsenal.tool.fluxSword.name=Fluxový meč 28 | item.redstonearsenal.tool.fluxWrench.name=Fluxový multi-kľúč 29 | 30 | tile.redstonearsenal.storage.crystalFlux.name=Kocka z fluxových kryštálov 31 | tile.redstonearsenal.storage.electrumFlux.name=Fluxovo-elektrová kocka 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/it_IT.lang: -------------------------------------------------------------------------------- 1 | #it_IT 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF per uso 4 | info.redstonearsenal.tool.shovel=Usabile anche come zappa. 5 | info.redstonearsenal.tool.wrench=Usabile anche come cesoie. 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=Stivali infusi di flux 8 | item.redstonearsenal.armor.fluxHelmet.name=Elmo infuso di flux 9 | item.redstonearsenal.armor.fluxLegs.name=Gambiera infusa di flux 10 | item.redstonearsenal.armor.fluxPlate.name=Corazza infusa di flux 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=Miscuglio di elettro infuso 13 | item.redstonearsenal.material.gemCrystalFlux.name=Cristallo di flux 14 | item.redstonearsenal.material.ingotElectrumFlux.name=Lingotto di elettro infuso 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=Pepita di elettro infuso 16 | item.redstonearsenal.material.plateFlux.name=Piastra per armatura infusa 17 | item.redstonearsenal.material.rodObsidian.name=Verga di ossidiana 18 | item.redstonearsenal.material.rodObsidianFlux.name=Verga di ossidiana infusa 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=Ascia infusa di flux 21 | item.redstonearsenal.tool.fluxBattleWrench.name=Chiave da battaglia infusa di flux 22 | item.redstonearsenal.tool.fluxBow.name=Arco infuso di flux 23 | item.redstonearsenal.tool.fluxFishingRod.name=Canna da pesca infusa di flux 24 | item.redstonearsenal.tool.fluxPickaxe.name=Piccone infuso di flux 25 | item.redstonearsenal.tool.fluxShovel.name=Pala infusa di flux 26 | item.redstonearsenal.tool.fluxSickle.name=Falce infusa di flux 27 | item.redstonearsenal.tool.fluxSword.name=Spada infusa di flux 28 | item.redstonearsenal.tool.fluxWrench.name=OmniChiave infuso di flux 29 | 30 | tile.redstonearsenal.storage.crystalFlux.name=Blocco di cristallo di flux 31 | tile.redstonearsenal.storage.electrumFlux.name=Blocco di elettro infuso 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/pt_BR.lang: -------------------------------------------------------------------------------- 1 | #pt_BR 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF por Uso RF Por Uso 4 | info.redstonearsenal.tool.shovel=Também serve como Enxada 5 | info.redstonearsenal.tool.wrench=Também serve como Tesoura 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=Botas com Flux Infundido 8 | item.redstonearsenal.armor.fluxHelmet.name=Elmo com Flux Infundido 9 | item.redstonearsenal.armor.fluxLegs.name=Calça com Flux Infundido 10 | item.redstonearsenal.armor.fluxPlate.name=Peitoral com Flux Infundido 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=Mistura de Electrum com Flux 13 | item.redstonearsenal.material.gemCrystalFlux.name=Cristal de Flux Fluxada 14 | item.redstonearsenal.material.ingotElectrumFlux.name=Lingote de Electrum Fluxado 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=Pepita de Electrum Fluxada 16 | item.redstonearsenal.material.plateFlux.name=Blindagem Fluxada 17 | item.redstonearsenal.material.rodObsidian.name=Vara de Obsidiana 18 | item.redstonearsenal.material.rodObsidianFlux.name=Vara de Obsidiana Infundida 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=Machado com Flux Infundido 21 | item.redstonearsenal.tool.fluxBattleWrench.name=Chave de Grifo de Batalha com Flux Infundido 22 | item.redstonearsenal.tool.fluxBow.name=Arco com Flux Infundido 23 | item.redstonearsenal.tool.fluxFishingRod.name=Vara de Pesca com Flux Infundido 24 | item.redstonearsenal.tool.fluxPickaxe.name=Picareta com Flux Infundido 25 | item.redstonearsenal.tool.fluxShovel.name=Pá com Flux Infundido 26 | item.redstonearsenal.tool.fluxSickle.name=Foice com Flux Infundido 27 | item.redstonearsenal.tool.fluxSword.name=Espada com Flux Infundido 28 | item.redstonearsenal.tool.fluxWrench.name=Chave de Grifo com Flux Infundido 29 | 30 | tile.redstonearsenal.storage.crystalFlux.name=Bloco de Cristal de Flux 31 | tile.redstonearsenal.storage.electrumFlux.name=Bloco de Electrum Fluxado 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/ru_RU.lang: -------------------------------------------------------------------------------- 1 | #ru_RU 2 | 3 | info.redstonearsenal.tool.energyPerUse=RF за использование 4 | info.redstonearsenal.tool.shovel=Также работает как мотыга. 5 | info.redstonearsenal.tool.wrench=Также работает как ножницы. 6 | 7 | item.redstonearsenal.armor.fluxBoots.name=Наполненные флаксом ботинки 8 | item.redstonearsenal.armor.fluxHelmet.name=Наполненный флаксом шлем 9 | item.redstonearsenal.armor.fluxLegs.name=Наполненные флаксом поножи 10 | item.redstonearsenal.armor.fluxPlate.name=Наполненная флаксом кираса 11 | 12 | item.redstonearsenal.material.dustElectrumFlux.name=Флаксовая электрумовая смесь 13 | item.redstonearsenal.material.gemCrystalFlux.name=Флаксовый кристалл 14 | item.redstonearsenal.material.ingotElectrumFlux.name=Флаксовый электрумовый слиток 15 | item.redstonearsenal.material.nuggetElectrumFlux.name=Флаксовый электрумовый самородок 16 | item.redstonearsenal.material.plateFlux.name=Флаксовая бронепластина 17 | item.redstonearsenal.material.rodObsidian.name=Обсидиановый стержень 18 | item.redstonearsenal.material.rodObsidianFlux.name=Наполненный флаксом обсидиановый стержень 19 | 20 | item.redstonearsenal.tool.fluxAxe.name=Наполненный флаксом топор 21 | item.redstonearsenal.tool.fluxBattleWrench.name=Наполненный флаксом боевой гаечный ключ 22 | item.redstonearsenal.tool.fluxBow.name=Наполненный флаксом лук 23 | item.redstonearsenal.tool.fluxFishingRod.name=Наполненная флаксом удочка 24 | item.redstonearsenal.tool.fluxHammer.name=Flux-Infused Hammer 25 | item.redstonearsenal.tool.fluxPickaxe.name=Наполненная флаксом кирка 26 | item.redstonearsenal.tool.fluxShovel.name=Наполненная флаксом лопата 27 | item.redstonearsenal.tool.fluxSickle.name=Наполненный флаксом серп 28 | item.redstonearsenal.tool.fluxSword.name=Наполненный флаксом меч 29 | item.redstonearsenal.tool.fluxWrench.name=Наполненный флаксом гаечный ключ 30 | 31 | tile.redstonearsenal.storage.crystalFlux.name=Блок флаксового кристалла 32 | tile.redstonearsenal.storage.electrumFlux.name=Флаксовый электрумовый блок 33 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemAxeRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.item.ItemAxe; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | 12 | public class ItemAxeRF extends ItemToolRF { 13 | 14 | public ItemAxeRF(ToolMaterial toolMaterial) { 15 | 16 | super(-2.8F, toolMaterial); 17 | addToolClass("axe"); 18 | damage = 8; 19 | energyPerUseCharged = 1600; 20 | 21 | effectiveBlocks.addAll(ItemAxe.EFFECTIVE_ON); 22 | 23 | effectiveMaterials.add(Material.WOOD); 24 | effectiveMaterials.add(Material.PLANTS); 25 | effectiveMaterials.add(Material.VINE); 26 | effectiveMaterials.add(Material.CACTUS); 27 | effectiveMaterials.add(Material.GOURD); 28 | } 29 | 30 | @Override 31 | public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { 32 | 33 | World world = player.worldObj; 34 | IBlockState state = world.getBlockState(pos); 35 | 36 | int x = pos.getX(); 37 | int y = pos.getY(); 38 | int z = pos.getZ(); 39 | 40 | Block block = state.getBlock(); 41 | 42 | float refStrength = state.getPlayerRelativeBlockHardness(player, world, pos); 43 | if (refStrength != 0.0F) { 44 | if (isEmpowered(stack) && (block.isWood(world, pos) || canHarvestBlock(state, stack))) { 45 | for (int i = x - 1; i <= x + 1; i++) { 46 | for (int k = z - 1; k <= z + 1; k++) { 47 | for (int j = y - 2; j <= y + 2; j++) { 48 | BlockPos pos2 = new BlockPos(i, j, k); 49 | block = world.getBlockState(pos2).getBlock(); 50 | if (block.isWood(world, pos2) || canHarvestBlock(state, stack)) { 51 | harvestBlock(world, pos2, player); 52 | } 53 | } 54 | } 55 | } 56 | } 57 | if (!player.capabilities.isCreativeMode) { 58 | useEnergy(stack, false); 59 | } 60 | } 61 | return false; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | #en_US 2 | 3 | info.redstonearsenal.tool.chargeOff=§ePress (%s) to Quell§r 4 | info.redstonearsenal.tool.chargeOn=§bPress (%s) to Empower§r 5 | 6 | info.redstonearsenal.tool.energyPerUse=RF Per Use 7 | info.redstonearsenal.tool.shovel=Also serves as a Hoe while Sneaking. 8 | info.redstonearsenal.tool.wrench=Also serves as Shears. 9 | 10 | item.redstonearsenal.armor.fluxBoots.name=Flux-Infused Boots 11 | item.redstonearsenal.armor.fluxHelmet.name=Flux-Infused Helm 12 | item.redstonearsenal.armor.fluxLegs.name=Flux-Infused Leggings 13 | item.redstonearsenal.armor.fluxPlate.name=Flux-Infused Chestplate 14 | 15 | item.redstonearsenal.material.dustElectrumFlux.name=Fluxed Electrum Blend 16 | item.redstonearsenal.material.gearElectrumFlux.name=Fluxed Electrum Gear 17 | item.redstonearsenal.material.gemCrystalFlux.name=Flux Crystal 18 | item.redstonearsenal.material.ingotElectrumFlux.name=Fluxed Electrum Ingot 19 | item.redstonearsenal.material.nuggetElectrumFlux.name=Fluxed Electrum Nugget 20 | item.redstonearsenal.material.plateFlux.name=Fluxed Armor Plating 21 | item.redstonearsenal.material.rodObsidian.name=Obsidian Rod 22 | item.redstonearsenal.material.rodObsidianFlux.name=Flux-Infused Obsidian Rod 23 | 24 | item.redstonearsenal.tool.fluxAxe.name=Flux-Infused Axe 25 | item.redstonearsenal.tool.fluxBattleWrench.name=Flux-Infused BattleWrench 26 | item.redstonearsenal.tool.fluxBow.name=Flux-Infused Bow 27 | item.redstonearsenal.tool.fluxFishingRod.name=Flux-Infused Fishing Rod 28 | item.redstonearsenal.tool.fluxHammer.name=Flux-Infused Hammer 29 | item.redstonearsenal.tool.fluxPickaxe.name=Flux-Infused Pickaxe 30 | item.redstonearsenal.tool.fluxShield.name=Flux-Infused Shield 31 | item.redstonearsenal.tool.fluxShovel.name=Flux-Infused Shovel 32 | item.redstonearsenal.tool.fluxSickle.name=Flux-Infused Sickle 33 | item.redstonearsenal.tool.fluxSword.name=Flux-Infused Sword 34 | item.redstonearsenal.tool.fluxWrench.name=Flux-Infused OmniWrench 35 | 36 | itemGroup.redstonearsenal.creativeTab=Redstone Arsenal 37 | 38 | tile.redstonearsenal.storage.crystalFlux.name=Flux Crystal Block 39 | tile.redstonearsenal.storage.electrumFlux.name=Fluxed Electrum Block 40 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/models/item/tool/flux/flux_bow.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "redstonearsenal:items/tool/flux/flux_bow" 5 | }, 6 | "display": { 7 | "thirdperson_righthand": { 8 | "rotation": [-80, 260, -40], 9 | "translation": [-1, -2, 2.5], 10 | "scale": [0.9, 0.9, 0.9] 11 | }, 12 | "thirdperson_lefthand": { 13 | "rotation": [-80, -280, 40], 14 | "translation": [-1, -2, 2.5], 15 | "scale": [0.9, 0.9, 0.9] 16 | }, 17 | "firstperson_righthand": { 18 | "rotation": [0, -90, 25], 19 | "translation": [1.13, 3.2, 1.13], 20 | "scale": [0.68, 0.68, 0.68] 21 | }, 22 | "firstperson_lefthand": { 23 | "rotation": [0, 90, -25], 24 | "translation": [1.13, 3.2, 1.13], 25 | "scale": [0.68, 0.68, 0.68] 26 | } 27 | }, 28 | "overrides": [ 29 | { 30 | "predicate": { 31 | "active": 1.0 32 | }, 33 | "model": "redstonearsenal:item/tool/flux/flux_bow_active" 34 | }, 35 | { 36 | "predicate": { 37 | "pulling": 1.0, 38 | "active": 1.0 39 | }, 40 | "model": "redstonearsenal:item/tool/flux/flux_bow_active_0" 41 | }, 42 | { 43 | "predicate": { 44 | "pulling": 1.0, 45 | "pull": 0.65, 46 | "active": 1.0 47 | }, 48 | "model": "redstonearsenal:item/tool/flux/flux_bow_active_1" 49 | }, 50 | { 51 | "predicate": { 52 | "pulling": 1.0, 53 | "pull": 0.9, 54 | "active": 1.0 55 | }, 56 | "model": "redstonearsenal:item/tool/flux/flux_bow_active_2" 57 | }, 58 | { 59 | "predicate": { 60 | "empowered": 1.0 61 | }, 62 | "model": "redstonearsenal:item/tool/flux/flux_bow_empowered" 63 | }, 64 | { 65 | "predicate": { 66 | "pulling": 1.0, 67 | "empowered": 1.0 68 | }, 69 | "model": "redstonearsenal:item/tool/flux/flux_bow_empowered_0" 70 | }, 71 | { 72 | "predicate": { 73 | "pulling": 1.0, 74 | "pull": 0.65, 75 | "empowered": 1.0 76 | }, 77 | "model": "redstonearsenal:item/tool/flux/flux_bow_empowered_1" 78 | }, 79 | { 80 | "predicate": { 81 | "pulling": 1.0, 82 | "pull": 0.9, 83 | "empowered": 1.0 84 | }, 85 | "model": "redstonearsenal:item/tool/flux/flux_bow_empowered_2" 86 | } 87 | ] 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemSickleRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.material.Material; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.init.Blocks; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | 12 | public class ItemSickleRF extends ItemToolRF { 13 | 14 | public int radius = 3; 15 | 16 | public ItemSickleRF(ToolMaterial toolMaterial) { 17 | 18 | super(-2.2F, toolMaterial); 19 | addToolClass("sickle"); 20 | damage = 5; 21 | energyPerUseCharged = 1200; 22 | 23 | effectiveBlocks.add(Blocks.WEB); 24 | effectiveBlocks.add(Blocks.VINE); 25 | effectiveBlocks.add(Blocks.LEAVES); 26 | effectiveBlocks.add(Blocks.LEAVES2); 27 | 28 | effectiveMaterials.add(Material.LEAVES); 29 | effectiveMaterials.add(Material.PLANTS); 30 | effectiveMaterials.add(Material.VINE); 31 | effectiveMaterials.add(Material.WEB); 32 | } 33 | 34 | public ItemSickleRF setRadius(int radius) { 35 | 36 | this.radius = radius; 37 | return this; 38 | } 39 | 40 | @Override 41 | public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { 42 | 43 | World world = player.worldObj; 44 | IBlockState state = world.getBlockState(pos); 45 | 46 | if (!canHarvestBlock(state, stack)) { 47 | if (!player.capabilities.isCreativeMode) { 48 | useEnergy(stack, false); 49 | } 50 | return false; 51 | } 52 | int x = pos.getX(); 53 | int y = pos.getY(); 54 | int z = pos.getZ(); 55 | 56 | boolean used = false; 57 | int boost = isEmpowered(stack) ? 2 : 0; 58 | world.playEvent(2001, pos, Block.getStateId(state)); 59 | 60 | for (int i = x - (radius + boost); i <= x + (radius + boost); i++) { 61 | for (int k = z - (radius + boost); k <= z + (radius + boost); k++) { 62 | for (int j = y - boost; j <= y + boost; j++) { 63 | used |= harvestBlock(world, new BlockPos(i, j, k), player); 64 | } 65 | } 66 | } 67 | if (used && !player.capabilities.isCreativeMode) { 68 | useEnergy(stack, false); 69 | } 70 | return true; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/resources/assets/redstonearsenal/lang/de_DE.lang: -------------------------------------------------------------------------------- 1 | #de_DE 2 | 3 | info.redstonearsenal.tool.chargeOff=§eDrücke (%s) zum Deaktivieren§r 4 | info.redstonearsenal.tool.chargeOn=§bDrücke (%s) zum Aktivieren§r 5 | 6 | info.redstonearsenal.tool.energyPerUse=RF je Nutzung 7 | info.redstonearsenal.tool.shovel=Dient auch als Hacke. 8 | info.redstonearsenal.tool.wrench=Dient auch als Schere. 9 | 10 | item.redstonearsenal.armor.fluxBoots.name=Fluxierende Stiefel 11 | item.redstonearsenal.armor.fluxHelmet.name=Fluxierender Helm 12 | item.redstonearsenal.armor.fluxLegs.name=Fluxierender Beinschutz 13 | item.redstonearsenal.armor.fluxPlate.name=Fluxierender Brustpanzer 14 | 15 | item.redstonearsenal.material.dustElectrumFlux.name=Fluxierende Elektrummischung 16 | item.redstonearsenal.material.gearElectrumFlux.name=Fluxierendes Elektrumzahnrad 17 | item.redstonearsenal.material.gemCrystalFlux.name=Fluxkristall 18 | item.redstonearsenal.material.ingotElectrumFlux.name=Fluxierender Elektrumbarren 19 | item.redstonearsenal.material.nuggetElectrumFlux.name=Fluxierender Elektrumnugget 20 | item.redstonearsenal.material.plateFlux.name=Fluxierende Rüstungsplatte 21 | item.redstonearsenal.material.rodObsidian.name=Obsidianstab 22 | item.redstonearsenal.material.rodObsidianFlux.name=Infundierter Obsidianstab 23 | 24 | item.redstonearsenal.tool.fluxAxe.name=Fluxierende Axt 25 | item.redstonearsenal.tool.fluxBattleWrench.name=Fluxierender Kampfschraubenschlüssel 26 | item.redstonearsenal.tool.fluxBow.name=Fluxierender Bogen 27 | item.redstonearsenal.tool.fluxFishingRod.name=Fluxierende Angelrute 28 | item.redstonearsenal.tool.fluxHammer.name=Fluxierender Hammer 29 | item.redstonearsenal.tool.fluxPickaxe.name=Fluxierende Spitzhacke 30 | item.redstonearsenal.tool.fluxShield.name=Fluxierender Schild 31 | item.redstonearsenal.tool.fluxShovel.name=Fluxierende Schaufel 32 | item.redstonearsenal.tool.fluxSickle.name=Fluxierende Sichel 33 | item.redstonearsenal.tool.fluxSword.name=Fluxierendes Schwert 34 | item.redstonearsenal.tool.fluxWrench.name=Fluxierender OmniWrench 35 | 36 | itemGroup.redstonearsenal.creativeTab=Redstone Arsenal 37 | 38 | tile.redstonearsenal.storage.crystalFlux.name=Fluxkristallblock 39 | tile.redstonearsenal.storage.electrumFlux.name=Fluxierender Elektrumblock 40 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/api/java/ic2/api/tile/IWrenchable.java: -------------------------------------------------------------------------------- 1 | package ic2.api.tile; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Allows a block to make use of the wrench's removal and rotation functions. 15 | */ 16 | public interface IWrenchable { 17 | 18 | /** 19 | * Get direction the block is facing. 20 | * 21 | * The direction typically refers to the front/main/functionally dominant side of a block. 22 | * 23 | * @param world World containing the block. 24 | * @param pos The block's current position in the world. 25 | * @return Current block facing. 26 | */ 27 | EnumFacing getFacing(World world, BlockPos pos); 28 | 29 | /** 30 | * Set the block's facing to face towards the specified direction. 31 | * 32 | * Contrary to Block.rotateBlock the block should always face the requested direction after 33 | * successfully processing this method. 34 | * 35 | * @param world World containing the block. 36 | * @param pos The block's current position in the world. 37 | * @param newDirection Requested facing, see {@link #getFacing}. 38 | * @param player Player causing the action, may be null. 39 | * @return true if successful, false otherwise. 40 | */ 41 | boolean setFacing(World world, BlockPos pos, EnumFacing newDirection, EntityPlayer player); 42 | 43 | /** 44 | * Determine if the wrench can be used to remove the block. 45 | * 46 | * @param world World containing the block. 47 | * @param pos The block's current position in the world. 48 | * @param player Player causing the action, may be null. 49 | * @return true if allowed, false otherwise. 50 | */ 51 | boolean wrenchCanRemove(World world, BlockPos pos, EntityPlayer player); 52 | 53 | /** 54 | * Determine the items the block will drop when the wrenching is successful. 55 | * 56 | * The ItemStack will be copied before creating the EntityItem. 57 | * 58 | * @param world World containing the block. 59 | * @param pos The block's current position in the world. 60 | * @param state The block's block state before removal. 61 | * @param te The block's tile entity before removal, if any, may be null. 62 | * @param player Player removing the block, may be null. 63 | * @param fortune Fortune level for drop calculation. 64 | * @return ItemStacks to drop, may be empty. 65 | */ 66 | List getWrenchDrops(World world, BlockPos pos, IBlockState state, TileEntity te, EntityPlayer player, int fortune); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CoFH "Don't Be a Jerk" License 2 | ==================================== 3 | #### Okay, so here's the deal. 4 | 5 | You'll notice that this repository does not have a license! By default, that means "All Rights Reserved." 6 | 7 | That is indeed the case. All rights reserved, as far as the code is concerned. 8 | 9 | Art and sound assets are released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0), a summary of which can be found at: https://creativecommons.org/licenses/by-sa/4.0/ 10 | 11 | ©2012-2017 Cult of the Full Hub / Team CoFH / CoFH 12 | 13 | #### Homepage 14 | 15 | [TeamCoFH Home Page](http://teamcofh.com/) 16 | 17 | [IRC #ThermalExpansion on esper.net](http://webchat.esper.net/?nick=ThermalWiki....&channels=ThermalExpansion) 18 | 19 | #### Notice 20 | 21 | Contribution to this repository means that you are granting us rights over the code that you choose to contribute. If you do not agree with that, do not contribute. 22 | 23 | So, why is this here? Well, the rights are reserved, but what that really means is that we choose what to do with the rights. So here you go. 24 | 25 | #### You CAN 26 | - Fork and modify the code. 27 | - Submit Pull Requests to this repository. 28 | - Copy portions of this code for use in other projects. 29 | - Write your own code that uses this code as a dependency. (addon mods!) 30 | 31 | #### You CANNOT 32 | - Redistribute this in its entirety as source or compiled code. 33 | - Create or distribute code which contains 50% or more Functionally Equivalent Statements* from this repository. 34 | 35 | #### You MUST 36 | - Maintain a visible repository of your code which is inspired by, derived from, or copied from this code. Basically, if you use it, pay it forward. You keep rights to your OWN code, but you still must make your source visible. 37 | - Not be a jerk**. Seriously, if you're a jerk, you can't use this code. That's part of the agreement. 38 | 39 | #### Notes, License & Copyright 40 | 41 | *A Functionally Equivalent Statement is a code fragment which, regardless of whitespace and object names, achieves the same result within the context of a Minecraft mod or addon. Basically you can't copy the code, rename the variables, add whitespace and say it's different. It's not. 42 | 43 | **A jerk is anyone who attempts to or intends to claim partial or total ownership of the original or repackaged code and/or attempts to or intends to redistribute original or repackaged code without prior express written permission from the owners (CoFH). 44 | 45 | Essentially, take this and learn from it! Create addon mods that depend on it! If you see something we can improve, tell us. Submit a Pull Request. The one catch: don't steal! A lot of effort has gone into this, and if you were to take this and call it your own, you'd basically be a big jerk. 46 | 47 | Don't be a jerk. 48 | 49 | See LICENSE-CODE.txt and LICENSE-ART.txt for license information. 50 | 51 | ©2012-2017 Cult of the Full Hub / Team CoFH / CoFH 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .gradle/ 7 | .project 8 | .metadata 9 | bin/ 10 | libs/ 11 | eclipse/ 12 | tmp/ 13 | *.tmp 14 | *.bak 15 | *.swp 16 | *~.nib 17 | local.properties 18 | .classpath 19 | .settings/ 20 | .loadpath 21 | crash-reports/ 22 | logs/ 23 | mods/ 24 | resourcepacks/ 25 | saves/ 26 | /options.txt 27 | 28 | # External tool builders 29 | .externalToolBuilders/ 30 | 31 | # Locally stored "Eclipse launch configurations" 32 | *.launch 33 | 34 | # CDT-specific 35 | .cproject 36 | 37 | # PDT-specific 38 | .buildpath 39 | 40 | 41 | ################# 42 | ## Visual Studio 43 | ################# 44 | 45 | ## Ignore Visual Studio temporary files, build results, and 46 | ## files generated by popular Visual Studio add-ons. 47 | 48 | # User-specific files 49 | *.suo 50 | *.user 51 | *.sln.docstates 52 | 53 | # Build results 54 | [Dd]ebug/ 55 | [Rr]elease/ 56 | *_i.c 57 | *_p.c 58 | *.ilk 59 | *.meta 60 | *.pch 61 | *.pdb 62 | *.pgc 63 | *.pgd 64 | *.rsp 65 | *.sbr 66 | *.tlb 67 | *.tli 68 | *.tlh 69 | *.tmp 70 | *.vspscc 71 | .builds 72 | *.dotCover 73 | 74 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 75 | #packages/ 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opensdf 82 | *.sdf 83 | 84 | # Visual Studio profiler 85 | *.psess 86 | *.vsp 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper* 90 | 91 | # Installshield output folder 92 | [Ee]xpress 93 | 94 | # DocProject is a documentation generator add-in 95 | DocProject/buildhelp/ 96 | DocProject/Help/*.HxT 97 | DocProject/Help/*.HxC 98 | DocProject/Help/*.hhc 99 | DocProject/Help/*.hhk 100 | DocProject/Help/*.hhp 101 | DocProject/Help/Html2 102 | DocProject/Help/html 103 | 104 | # Click-Once directory 105 | publish 106 | 107 | # Others 108 | [Bb]in 109 | [Oo]bj 110 | sql 111 | TestResults 112 | *.Cache 113 | ClientBin 114 | stylecop.* 115 | ~$* 116 | *.dbmdl 117 | Generated_Code #added for RIA/Silverlight projects 118 | 119 | # Backup & report files from converting an old project file to a newer 120 | # Visual Studio version. Backup files are not needed, because we have git ;-) 121 | _UpgradeReport_Files/ 122 | Backup*/ 123 | UpgradeLog*.XML 124 | 125 | 126 | 127 | ############ 128 | ## Windows 129 | ############ 130 | 131 | # Windows image file caches 132 | Thumbs.db 133 | 134 | # Folder config file 135 | Desktop.ini 136 | 137 | 138 | ############# 139 | ## Python 140 | ############# 141 | 142 | *.py[co] 143 | 144 | # Packages 145 | *.egg 146 | *.egg-info 147 | dist 148 | build 149 | eggs 150 | parts 151 | bin 152 | var 153 | sdist 154 | develop-eggs 155 | .installed.cfg 156 | 157 | # Installer logs 158 | pip-log.txt 159 | 160 | # Unit test / coverage reports 161 | .coverage 162 | .tox 163 | 164 | #Translations 165 | *.mo 166 | 167 | #Mr Developer 168 | .mr.developer.cfg 169 | 170 | # Mac crap 171 | .DS_Store 172 | 173 | ########### 174 | 175 | downloads 176 | screenshots 177 | techne 178 | 179 | ############# 180 | ## denoflions 181 | ############# 182 | 183 | MFR-Forestry 184 | nbproject 185 | *.iml 186 | *.eml 187 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/ItemMaterial.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item; 2 | 3 | import cofh.api.util.ThermalExpansionHelper; 4 | import cofh.core.item.ItemMulti; 5 | import cofh.core.util.core.IInitializer; 6 | import cofh.redstonearsenal.RedstoneArsenal; 7 | import cofh.thermalfoundation.init.TFFluids; 8 | import net.minecraft.init.Blocks; 9 | import net.minecraft.init.Items; 10 | import net.minecraft.item.EnumRarity; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraftforge.fluids.FluidStack; 13 | import net.minecraftforge.fml.common.Loader; 14 | 15 | import static cofh.lib.util.helpers.ItemHelper.*; 16 | 17 | public class ItemMaterial extends ItemMulti implements IInitializer { 18 | 19 | public ItemMaterial() { 20 | 21 | super("redstonearsenal"); 22 | 23 | setUnlocalizedName("material"); 24 | setCreativeTab(RedstoneArsenal.tabCommon); 25 | } 26 | 27 | /* IInitializer */ 28 | @Override 29 | public boolean preInit() { 30 | 31 | dustElectrumFlux = addOreDictItem(0, "dustElectrumFlux", EnumRarity.UNCOMMON); 32 | ingotElectrumFlux = addOreDictItem(32, "ingotElectrumFlux", EnumRarity.UNCOMMON); 33 | nuggetElectrumFlux = addOreDictItem(64, "nuggetElectrumFlux", EnumRarity.UNCOMMON); 34 | gearElectrumFlux = addOreDictItem(96, "gearElectrumFlux", EnumRarity.UNCOMMON); 35 | 36 | gemCrystalFlux = addOreDictItem(128, "gemCrystalFlux", EnumRarity.UNCOMMON); 37 | 38 | plateFlux = addItem(160, "plateFlux", EnumRarity.UNCOMMON); 39 | 40 | rodObsidian = addItem(192, "rodObsidian"); 41 | rodObsidianFlux = addItem(193, "rodObsidianFlux", EnumRarity.UNCOMMON); 42 | 43 | RedstoneArsenal.proxy.addIModelRegister(this); 44 | 45 | return true; 46 | } 47 | 48 | @Override 49 | public boolean initialize() { 50 | 51 | addTwoWayStorageRecipe(ingotElectrumFlux, "ingotElectrumFlux", nuggetElectrumFlux, "nuggetElectrumFlux"); 52 | 53 | addReverseStorageRecipe(ingotElectrumFlux, "blockElectrumFlux"); 54 | addReverseStorageRecipe(gemCrystalFlux, "blockCrystalFlux"); 55 | 56 | addGearRecipe(gearElectrumFlux, "ingotElectrumFlux"); 57 | 58 | addRecipe(ShapedRecipe(plateFlux, "NNN", "GIG", "NNN", 'G', "gemCrystalFlux", 'I', "ingotElectrumFlux", 'N', "nuggetElectrumFlux")); 59 | addRecipe(ShapedRecipe(rodObsidianFlux, " O", " B ", "O ", 'B', rodObsidian, 'O', "gemCrystalFlux")); 60 | addRecipe(ShapedRecipe(rodObsidian, " O", " B ", "O ", 'B', Items.BLAZE_POWDER, 'O', "dustObsidian")); 61 | 62 | if (!Loader.isModLoaded("thermalexpansion")) { 63 | addRecipe(ShapelessRecipe(dustElectrumFlux, "dustElectrum", "dustRedstone", "dustRedstone", "dustRedstone", "dustRedstone", "dustRedstone")); 64 | addRecipe(ShapelessRecipe(gemCrystalFlux, "gemDiamond", "dustRedstone", "dustRedstone", "dustRedstone", "dustRedstone", "dustRedstone")); 65 | addSmelting(ingotElectrumFlux, dustElectrumFlux, 0.0F); 66 | } else { 67 | ThermalExpansionHelper.addSmelterRecipe(4000, dustElectrumFlux, new ItemStack(Blocks.SAND), ingotElectrumFlux); 68 | ThermalExpansionHelper.addTransposerFill(4000, cofh.thermalfoundation.item.ItemMaterial.dustElectrum, dustElectrumFlux, new FluidStack(TFFluids.fluidRedstone, 500), false); 69 | ThermalExpansionHelper.addTransposerFill(4000, new ItemStack(Items.DIAMOND), gemCrystalFlux, new FluidStack(TFFluids.fluidRedstone, 500), false); 70 | } 71 | return true; 72 | } 73 | 74 | @Override 75 | public boolean postInit() { 76 | 77 | return true; 78 | } 79 | 80 | /* REFERENCES */ 81 | public static ItemStack dustElectrumFlux; 82 | public static ItemStack ingotElectrumFlux; 83 | public static ItemStack nuggetElectrumFlux; 84 | public static ItemStack gearElectrumFlux; 85 | 86 | public static ItemStack gemCrystalFlux; 87 | 88 | public static ItemStack plateFlux; 89 | 90 | public static ItemStack rodObsidian; 91 | public static ItemStack rodObsidianFlux; 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemHammerRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.lib.util.RayTracer; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.material.Material; 6 | import net.minecraft.block.state.IBlockState; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.item.ItemPickaxe; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.math.RayTraceResult; 12 | import net.minecraft.world.World; 13 | 14 | public class ItemHammerRF extends ItemToolRF { 15 | 16 | public ItemHammerRF(ToolMaterial toolMaterial) { 17 | 18 | super(-3.6F, toolMaterial); 19 | addToolClass("pickaxe"); 20 | addToolClass("hammer"); 21 | damage = 11; 22 | energyPerUseCharged = 1600; 23 | 24 | effectiveBlocks.addAll(ItemPickaxe.EFFECTIVE_ON); 25 | 26 | effectiveMaterials.add(Material.IRON); 27 | effectiveMaterials.add(Material.ANVIL); 28 | effectiveMaterials.add(Material.ROCK); 29 | effectiveMaterials.add(Material.ICE); 30 | effectiveMaterials.add(Material.PACKED_ICE); 31 | effectiveMaterials.add(Material.GLASS); 32 | effectiveMaterials.add(Material.REDSTONE_LIGHT); 33 | } 34 | 35 | @Override 36 | public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { 37 | 38 | World world = player.worldObj; 39 | IBlockState state = world.getBlockState(pos); 40 | 41 | if (!canHarvestBlock(state, stack)) { 42 | if (!player.capabilities.isCreativeMode) { 43 | useEnergy(stack, false); 44 | } 45 | return false; 46 | } 47 | boolean used = false; 48 | world.playEvent(2001, pos, Block.getStateId(state)); 49 | 50 | float refStrength = state.getPlayerRelativeBlockHardness(player, world, pos); 51 | if (refStrength != 0.0F) { 52 | RayTraceResult traceResult = RayTracer.retrace(player); 53 | 54 | if (traceResult == null) { 55 | return false; 56 | } 57 | BlockPos adjPos; 58 | IBlockState adjState; 59 | float strength; 60 | 61 | int x = pos.getX(); 62 | int y = pos.getY(); 63 | int z = pos.getZ(); 64 | 65 | int radius = isEmpowered(stack) ? 2 : 1; 66 | 67 | switch (traceResult.sideHit) { 68 | case DOWN: 69 | case UP: 70 | for (x = pos.getX() - radius; x <= pos.getX() + radius; x++) { 71 | for (z = pos.getZ() - radius; z <= pos.getZ() + radius; z++) { 72 | adjPos = new BlockPos(x, y, z); 73 | adjState = world.getBlockState(adjPos); 74 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 75 | if (strength > 0F && refStrength / strength <= 10F) { 76 | used |= harvestBlock(world, adjPos, player); 77 | } 78 | } 79 | } 80 | break; 81 | case NORTH: 82 | case SOUTH: 83 | for (x = pos.getX() - radius; x <= pos.getX() + radius; x++) { 84 | for (y = pos.getY() - radius; y <= pos.getY() + radius; y++) { 85 | adjPos = new BlockPos(x, y, z); 86 | adjState = world.getBlockState(adjPos); 87 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 88 | if (strength > 0F && refStrength / strength <= 10F) { 89 | used |= harvestBlock(world, adjPos, player); 90 | } 91 | } 92 | } 93 | break; 94 | case WEST: 95 | case EAST: 96 | for (y = pos.getY() - radius; y <= pos.getY() + radius; y++) { 97 | for (z = pos.getZ() - radius; z <= pos.getZ() + radius; z++) { 98 | adjPos = new BlockPos(x, y, z); 99 | adjState = world.getBlockState(adjPos); 100 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 101 | if (strength > 0F && refStrength / strength <= 10F) { 102 | used |= harvestBlock(world, adjPos, player); 103 | } 104 | } 105 | } 106 | break; 107 | } 108 | if (used && !player.capabilities.isCreativeMode) { 109 | useEnergy(stack, false); 110 | } 111 | } 112 | return true; 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/RedstoneArsenal.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal; 2 | 3 | import cofh.CoFHCore; 4 | import cofh.core.init.CoreProps; 5 | import cofh.core.util.ConfigHandler; 6 | import cofh.redstonearsenal.init.RABlocks; 7 | import cofh.redstonearsenal.init.RAEquipment; 8 | import cofh.redstonearsenal.init.RAItems; 9 | import cofh.redstonearsenal.init.RAProps; 10 | import cofh.redstonearsenal.proxy.Proxy; 11 | import cofh.thermalfoundation.ThermalFoundation; 12 | import net.minecraft.creativetab.CreativeTabs; 13 | import net.minecraftforge.common.config.Configuration; 14 | import net.minecraftforge.fml.common.Mod; 15 | import net.minecraftforge.fml.common.Mod.EventHandler; 16 | import net.minecraftforge.fml.common.Mod.Instance; 17 | import net.minecraftforge.fml.common.SidedProxy; 18 | import net.minecraftforge.fml.common.event.*; 19 | import net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent; 20 | import org.apache.logging.log4j.LogManager; 21 | import org.apache.logging.log4j.Logger; 22 | 23 | import java.io.File; 24 | 25 | @Mod (modid = RedstoneArsenal.MOD_ID, name = RedstoneArsenal.MOD_NAME, version = RedstoneArsenal.VERSION, dependencies = RedstoneArsenal.DEPENDENCIES, updateJSON = RedstoneArsenal.UPDATE_URL) 26 | public class RedstoneArsenal { 27 | 28 | public static final String MOD_ID = "redstonearsenal"; 29 | public static final String MOD_NAME = "Redstone Arsenal"; 30 | public static final String VERSION = "2.0.4"; 31 | public static final String VERSION_MAX = "2.1.0"; 32 | public static final String VERSION_GROUP = "required-after:" + MOD_ID + "@[" + VERSION + "," + VERSION_MAX + ");"; 33 | public static final String UPDATE_URL = "https://raw.github.com/cofh/version/master/" + MOD_ID + "_update.json"; 34 | 35 | public static final String DEPENDENCIES = CoFHCore.VERSION_GROUP + ThermalFoundation.VERSION_GROUP + "after:ThermalExpansion;"; 36 | public static final String MOD_GUI_FACTORY = "cofh.redstonearsenal.gui.GuiConfigRAFactory"; 37 | 38 | @Instance (MOD_ID) 39 | public static RedstoneArsenal instance; 40 | 41 | @SidedProxy (clientSide = "cofh.redstonearsenal.proxy.ProxyClient", serverSide = "cofh.redstonearsenal.proxy.Proxy") 42 | public static Proxy proxy; 43 | 44 | public static final Logger LOG = LogManager.getLogger(MOD_ID); 45 | public static final ConfigHandler CONFIG = new ConfigHandler(VERSION); 46 | public static final ConfigHandler CONFIG_CLIENT = new ConfigHandler(VERSION); 47 | 48 | public static CreativeTabs tabCommon; 49 | 50 | public RedstoneArsenal() { 51 | 52 | super(); 53 | } 54 | 55 | /* INIT */ 56 | @EventHandler 57 | public void preInit(FMLPreInitializationEvent event) { 58 | 59 | CONFIG.setConfiguration(new Configuration(new File(CoreProps.configDir, "/cofh/" + MOD_ID + "/common.cfg"), true)); 60 | CONFIG_CLIENT.setConfiguration(new Configuration(new File(CoreProps.configDir, "/cofh/" + MOD_ID + "/client.cfg"), true)); 61 | 62 | RAProps.preInit(); 63 | RABlocks.preInit(); 64 | RAItems.preInit(); 65 | RAEquipment.preInit(); 66 | 67 | proxy.preInit(event); 68 | } 69 | 70 | @EventHandler 71 | public void initialize(FMLInitializationEvent event) { 72 | 73 | RABlocks.initialize(); 74 | RAItems.initialize(); 75 | RAEquipment.initialize(); 76 | 77 | proxy.initialize(event); 78 | } 79 | 80 | @EventHandler 81 | public void postInit(FMLPostInitializationEvent event) { 82 | 83 | RABlocks.postInit(); 84 | RAItems.postInit(); 85 | RAEquipment.postInit(); 86 | 87 | proxy.postInit(event); 88 | } 89 | 90 | @EventHandler 91 | public void loadComplete(FMLLoadCompleteEvent event) { 92 | 93 | RAProps.loadComplete(); 94 | CONFIG.cleanUp(false, true); 95 | CONFIG_CLIENT.cleanUp(false, true); 96 | 97 | LOG.info(MOD_NAME + ": Load Complete."); 98 | } 99 | 100 | @EventHandler 101 | public void serverStart(FMLServerAboutToStartEvent event) { 102 | 103 | } 104 | 105 | @EventHandler 106 | public void serverStarting(FMLServerStartingEvent event) { 107 | 108 | } 109 | 110 | @EventHandler 111 | public void handleIMC(IMCEvent event) { 112 | 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /src/main/resources/cofh_at.cfg: -------------------------------------------------------------------------------- 1 | # 1.10.2 2 | # CoFH Master AT List 3 | 4 | public net.minecraft.client.gui.FontRenderer func_78280_d(Ljava/lang/String;I)Ljava/lang/String; # wrapFormattedStringToWidth 5 | public net.minecraft.client.gui.inventory.GuiContainer * # EVERYTHING 6 | 7 | public net.minecraft.client.multiplayer.PlayerControllerMP field_178895_c # currentBlock 8 | public net.minecraft.client.multiplayer.PlayerControllerMP field_78770_f # curBlockDamageMP 9 | public net.minecraft.client.multiplayer.PlayerControllerMP field_78778_j # isHittingBlock 10 | public net.minecraft.client.multiplayer.PlayerControllerMP field_85183_f # currentItemHittingBlock 11 | 12 | public net.minecraft.client.particle.Particle field_187129_i # motionX 13 | public net.minecraft.client.particle.Particle field_187130_j # motionY 14 | public net.minecraft.client.particle.Particle field_187131_k # motionZ 15 | 16 | public net.minecraft.client.particle.ParticleFirework$Spark field_92050_aA # fadeColourRed 17 | public net.minecraft.client.particle.ParticleFirework$Spark field_92051_aB # fadeColourGreen 18 | public net.minecraft.client.particle.ParticleFirework$Spark field_92052_aC # fadeColourBlue 19 | public net.minecraft.client.particle.ParticleFirework$Spark field_92053_aD # hasFadeColour 20 | 21 | public net.minecraft.client.particle.ParticlePortal (Lnet/minecraft/world/World;DDDDDD)V # ParticlePortal 22 | public net.minecraft.client.particle.ParticleSimpleAnimated field_187147_a # textureIdx 23 | 24 | public net.minecraft.client.renderer.VertexBuffer field_179010_r # isDrawing 25 | 26 | public net.minecraft.entity.Entity field_70178_ae # isImmuneToFire 27 | public net.minecraft.entity.Entity field_83001_bt # invulnerable 28 | 29 | public net.minecraft.entity.EntityLiving field_184655_bs # inventoryArmorDropChances 30 | public net.minecraft.entity.EntityLiving field_82174_bp # inventoryHandsDropChances 31 | 32 | public net.minecraft.entity.EntityLivingBase field_184627_bm # activeItemStack 33 | 34 | public net.minecraft.entity.item.EntityItem field_70292_b # age 35 | 36 | public net.minecraft.entity.projectile.EntityFishHook * # EVERYTHING 37 | 38 | public net.minecraft.inventory.Container field_94535_f # dragMode 39 | public net.minecraft.inventory.Container field_94536_g # dragEvent 40 | public net.minecraft.inventory.Container field_94537_h # dragSlots 41 | 42 | public net.minecraft.item.ItemAxe field_150917_c # EFFECTIVE_ON 43 | public net.minecraft.item.ItemBow func_185060_a(Lnet/minecraft/entity/player/EntityPlayer;)Lnet/minecraft/item/ItemStack; # findAmmo 44 | public net.minecraft.item.ItemPickaxe field_150915_c # EFFECTIVE_ON 45 | public net.minecraft.item.ItemSpade field_150916_c # EFFECTIVE_ON 46 | 47 | public net.minecraft.nbt.NBTTagByteArray func_74734_a(Ljava/io/DataOutput;)V # write 48 | 49 | public net.minecraft.server.management.PlayerChunkMapEntry field_187283_c # players 50 | public net.minecraft.server.management.PlayerInteractionManager field_73094_o # durabilityRemainingOnBlock 51 | public net.minecraft.server.management.PlayerProfileCache field_152661_c # usernameToProfileEntryMap 52 | public net.minecraft.server.management.PlayerProfileCache$ProfileEntry # ProfileEntry 53 | 54 | public net.minecraft.util.registry.RegistryNamespaced field_148759_a # underlyingIntegerMap 55 | public net.minecraft.util.registry.RegistrySimple field_82596_a # registryObjects 56 | 57 | public net.minecraft.world.chunk.Chunk field_150816_i # chunkTileEntityMap 58 | public net.minecraft.world.chunk.Chunk field_76636_d # isChunkLoaded 59 | 60 | public net.minecraft.world.World field_72999_e # scheduledUpdatesAreImmediate 61 | public net.minecraft.world.World field_73008_k # skylightSubtracted 62 | public net.minecraft.world.World field_73016_r # lastLightningBolt 63 | 64 | public net.minecraft.world.WorldServer field_73068_P # allPlayersSleeping 65 | 66 | public-f net.minecraft.entity.player.InventoryPlayer field_70462_a # mainInventory 67 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemPickaxeRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.lib.util.RayTracer; 4 | import cofh.lib.util.helpers.MathHelper; 5 | import gnu.trove.set.hash.THashSet; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.block.material.Material; 8 | import net.minecraft.block.state.IBlockState; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.item.ItemPickaxe; 11 | import net.minecraft.item.ItemSpade; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.util.math.BlockPos; 14 | import net.minecraft.util.math.RayTraceResult; 15 | import net.minecraft.world.World; 16 | 17 | import static net.minecraft.util.EnumFacing.DOWN; 18 | import static net.minecraft.util.EnumFacing.UP; 19 | 20 | public class ItemPickaxeRF extends ItemToolRF { 21 | 22 | public THashSet effectiveBlocksCharged = new THashSet<>(); 23 | 24 | public ItemPickaxeRF(ToolMaterial toolMaterial) { 25 | 26 | super(-2.7F, toolMaterial); 27 | addToolClass("pickaxe"); 28 | damage = 4; 29 | energyPerUseCharged = 800; 30 | 31 | effectiveBlocks.addAll(ItemPickaxe.EFFECTIVE_ON); 32 | effectiveBlocksCharged.addAll(ItemPickaxe.EFFECTIVE_ON); 33 | effectiveBlocksCharged.addAll(ItemSpade.EFFECTIVE_ON); 34 | 35 | effectiveMaterials.add(Material.IRON); 36 | effectiveMaterials.add(Material.ANVIL); 37 | effectiveMaterials.add(Material.ROCK); 38 | effectiveMaterials.add(Material.ICE); 39 | effectiveMaterials.add(Material.PACKED_ICE); 40 | effectiveMaterials.add(Material.GLASS); 41 | effectiveMaterials.add(Material.REDSTONE_LIGHT); 42 | } 43 | 44 | @Override 45 | protected THashSet getEffectiveBlocks(ItemStack stack) { 46 | 47 | return isEmpowered(stack) ? effectiveBlocksCharged : super.getEffectiveBlocks(stack); 48 | } 49 | 50 | @Override 51 | public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { 52 | 53 | World world = player.worldObj; 54 | IBlockState state = world.getBlockState(pos); 55 | 56 | int x = pos.getX(); 57 | int y = pos.getY(); 58 | int z = pos.getZ(); 59 | 60 | float refStrength = state.getPlayerRelativeBlockHardness(player, world, pos); 61 | if (refStrength != 0.0F) { 62 | if (isEmpowered(stack) && canHarvestBlock(state, stack)) { 63 | RayTraceResult traceResult = RayTracer.retrace(player); 64 | 65 | if (traceResult == null) { 66 | return false; 67 | } 68 | BlockPos adjPos; 69 | IBlockState adjState; 70 | float strength; 71 | 72 | if (traceResult.sideHit == DOWN || traceResult.sideHit == UP) { 73 | int facing = MathHelper.floor(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; 74 | if (facing % 2 == 0) { 75 | adjPos = new BlockPos(x, y, z - 1); 76 | adjState = world.getBlockState(adjPos); 77 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 78 | if (strength > 0F && refStrength / strength <= 10F) { 79 | harvestBlock(world, adjPos, player); 80 | } 81 | adjPos = new BlockPos(x, y, z + 1); 82 | adjState = world.getBlockState(adjPos); 83 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 84 | if (strength > 0F && refStrength / strength <= 10F) { 85 | harvestBlock(world, adjPos, player); 86 | } 87 | } else { 88 | adjPos = new BlockPos(x - 1, y, z); 89 | adjState = world.getBlockState(adjPos); 90 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 91 | if (strength > 0F && refStrength / strength <= 10F) { 92 | harvestBlock(world, adjPos, player); 93 | } 94 | adjPos = new BlockPos(x + 1, y, z); 95 | adjState = world.getBlockState(adjPos); 96 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 97 | if (strength > 0F && refStrength / strength <= 10F) { 98 | harvestBlock(world, adjPos, player); 99 | } 100 | } 101 | } else { 102 | adjPos = new BlockPos(x, y - 1, z); 103 | adjState = world.getBlockState(adjPos); 104 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 105 | if (strength > 0F && refStrength / strength <= 10F) { 106 | harvestBlock(world, adjPos, player); 107 | } 108 | adjPos = new BlockPos(x, y + 1, z); 109 | adjState = world.getBlockState(adjPos); 110 | strength = adjState.getPlayerRelativeBlockHardness(player, world, adjPos); 111 | if (strength > 0F && refStrength / strength <= 10F) { 112 | harvestBlock(world, adjPos, player); 113 | } 114 | } 115 | } 116 | if (!player.capabilities.isCreativeMode) { 117 | useEnergy(stack, false); 118 | } 119 | } 120 | return false; 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/armor/ItemArmorRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.armor; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.core.item.ItemArmorCore; 5 | import cofh.lib.util.helpers.EnergyHelper; 6 | import cofh.lib.util.helpers.ItemHelper; 7 | import cofh.lib.util.helpers.MathHelper; 8 | import cofh.lib.util.helpers.StringHelper; 9 | import cofh.redstonearsenal.init.RAProps; 10 | import net.minecraft.creativetab.CreativeTabs; 11 | import net.minecraft.enchantment.EnchantmentHelper; 12 | import net.minecraft.entity.EntityLivingBase; 13 | import net.minecraft.entity.player.EntityPlayer; 14 | import net.minecraft.init.Enchantments; 15 | import net.minecraft.inventory.EntityEquipmentSlot; 16 | import net.minecraft.item.EnumRarity; 17 | import net.minecraft.item.Item; 18 | import net.minecraft.item.ItemStack; 19 | import net.minecraft.util.DamageSource; 20 | import net.minecraftforge.common.ISpecialArmor; 21 | import net.minecraftforge.fml.relauncher.Side; 22 | import net.minecraftforge.fml.relauncher.SideOnly; 23 | 24 | import javax.annotation.Nonnull; 25 | import java.util.List; 26 | 27 | public class ItemArmorRF extends ItemArmorCore implements ISpecialArmor, IEnergyContainerItem { 28 | 29 | private static final ArmorProperties FLUX = new ArmorProperties(0, 0.20D, Integer.MAX_VALUE); 30 | 31 | protected int maxEnergy = 400000; 32 | protected int maxTransfer = 2000; 33 | 34 | protected double absorbRatio = 0.9D; 35 | protected int energyPerDamage = 160; 36 | 37 | public ItemArmorRF(ArmorMaterial material, EntityEquipmentSlot type) { 38 | 39 | super(material, type); 40 | } 41 | 42 | public ItemArmorRF setEnergyParams(int maxEnergy, int maxTransfer) { 43 | 44 | this.maxEnergy = maxEnergy; 45 | this.maxTransfer = maxTransfer; 46 | 47 | return this; 48 | } 49 | 50 | protected int getEnergyPerDamage(ItemStack stack) { 51 | 52 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 53 | return energyPerDamage * (5 - unbreakingLevel) / 5; 54 | } 55 | 56 | @Override 57 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 58 | 59 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 60 | list.add(StringHelper.shiftForDetails()); 61 | } 62 | if (!StringHelper.isShiftKeyDown()) { 63 | return; 64 | } 65 | if (stack.getTagCompound() == null) { 66 | EnergyHelper.setDefaultEnergyTag(stack, 0); 67 | } 68 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 69 | } 70 | 71 | @Override 72 | @SideOnly (Side.CLIENT) 73 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 74 | 75 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), 0)); 76 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), maxEnergy)); 77 | } 78 | 79 | @Override 80 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 81 | 82 | return false; 83 | } 84 | 85 | @Override 86 | public boolean isDamaged(ItemStack stack) { 87 | 88 | return true; 89 | } 90 | 91 | @Override 92 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 93 | 94 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 95 | } 96 | 97 | @Override 98 | public boolean showDurabilityBar(ItemStack stack) { 99 | 100 | return !RAProps.showArmorCharge ? false : stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("CreativeTab"); 101 | } 102 | 103 | @Override 104 | public int getMaxDamage(ItemStack stack) { 105 | 106 | return 0; 107 | } 108 | 109 | @Override 110 | public double getDurabilityForDisplay(ItemStack stack) { 111 | 112 | if (stack.getTagCompound() == null) { 113 | EnergyHelper.setDefaultEnergyTag(stack, 0); 114 | } 115 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 116 | } 117 | 118 | @Override 119 | public EnumRarity getRarity(ItemStack stack) { 120 | 121 | return EnumRarity.UNCOMMON; 122 | } 123 | 124 | /* ISpecialArmor */ 125 | @Override 126 | public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { 127 | 128 | if (source.damageType.equals("flux")) { 129 | return FLUX; 130 | } else if (source.isUnblockable()) { 131 | int absorbMax = getEnergyPerDamage(armor) > 0 ? 25 * getEnergyStored(armor) / getEnergyPerDamage(armor) : 0; 132 | return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.025, absorbMax); 133 | } 134 | int absorbMax = getEnergyPerDamage(armor) > 0 ? 25 * getEnergyStored(armor) / getEnergyPerDamage(armor) : 0; 135 | return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.05, absorbMax); 136 | // 0.05 = 1 / 20 (max armor) 137 | } 138 | 139 | @Override 140 | public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { 141 | 142 | if (getEnergyStored(armor) >= getEnergyPerDamage(armor)) { 143 | return getArmorMaterial().getDamageReductionAmount(armorType); 144 | } 145 | return 0; 146 | } 147 | 148 | @Override 149 | public void damageArmor(EntityLivingBase entity, ItemStack armor, DamageSource source, int damage, int slot) { 150 | 151 | if (source.damageType.equals("flux")) { 152 | boolean p = source.getEntity() == null; 153 | receiveEnergy(armor, damage * (p ? energyPerDamage / 2 : getEnergyPerDamage(armor)), false); 154 | } else { 155 | extractEnergy(armor, damage * getEnergyPerDamage(armor), false); 156 | } 157 | } 158 | 159 | /* IEnergyContainerItem */ 160 | @Override 161 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 162 | 163 | if (container.getTagCompound() == null) { 164 | EnergyHelper.setDefaultEnergyTag(container, 0); 165 | } 166 | int stored = container.getTagCompound().getInteger("Energy"); 167 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 168 | 169 | if (!simulate) { 170 | stored += receive; 171 | container.getTagCompound().setInteger("Energy", stored); 172 | } 173 | return receive; 174 | } 175 | 176 | @Override 177 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 178 | 179 | if (container.getTagCompound() == null) { 180 | EnergyHelper.setDefaultEnergyTag(container, 0); 181 | } 182 | int stored = container.getTagCompound().getInteger("Energy"); 183 | int extract = Math.min(maxExtract, stored); 184 | 185 | if (!simulate) { 186 | stored -= extract; 187 | container.getTagCompound().setInteger("Energy", stored); 188 | } 189 | return extract; 190 | } 191 | 192 | @Override 193 | public int getEnergyStored(ItemStack container) { 194 | 195 | if (container.getTagCompound() == null) { 196 | EnergyHelper.setDefaultEnergyTag(container, 0); 197 | } 198 | return container.getTagCompound().getInteger("Energy"); 199 | } 200 | 201 | @Override 202 | public int getMaxEnergyStored(ItemStack container) { 203 | 204 | return maxEnergy; 205 | } 206 | 207 | } 208 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemBattleWrenchRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.block.IDismantleable; 4 | import cofh.api.item.IToolHammer; 5 | import cofh.asm.relauncher.Implementable; 6 | import cofh.lib.util.helpers.BlockHelper; 7 | import cofh.lib.util.helpers.ServerHelper; 8 | import net.minecraft.block.Block; 9 | import net.minecraft.block.state.IBlockState; 10 | import net.minecraft.entity.Entity; 11 | import net.minecraft.entity.EntityLivingBase; 12 | import net.minecraft.entity.item.EntityMinecart; 13 | import net.minecraft.entity.player.EntityPlayer; 14 | import net.minecraft.item.ItemStack; 15 | import net.minecraft.util.EnumActionResult; 16 | import net.minecraft.util.EnumFacing; 17 | import net.minecraft.util.EnumHand; 18 | import net.minecraft.util.math.BlockPos; 19 | import net.minecraft.util.math.RayTraceResult; 20 | import net.minecraft.util.math.Vec3d; 21 | import net.minecraft.world.IBlockAccess; 22 | import net.minecraft.world.World; 23 | import net.minecraftforge.common.MinecraftForge; 24 | import net.minecraftforge.event.entity.player.PlayerInteractEvent; 25 | import net.minecraftforge.fml.common.eventhandler.Event.Result; 26 | 27 | @Implementable ({ "buildcraft.api.tools.IToolWrench", "mods.railcraft.api.core.items.IToolCrowbar" }) 28 | public class ItemBattleWrenchRF extends ItemSwordRF implements IToolHammer { 29 | 30 | public ItemBattleWrenchRF(ToolMaterial toolMaterial) { 31 | 32 | super(toolMaterial); 33 | setHarvestLevel("wrench", 1); 34 | damage = 6; 35 | damageCharged = 3; 36 | } 37 | 38 | @Override 39 | public boolean doesSneakBypassUse(ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player) { 40 | 41 | return true; 42 | } 43 | 44 | @Override 45 | public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase player) { 46 | 47 | entity.rotationYaw += 90; 48 | entity.rotationYaw %= 360; 49 | return super.hitEntity(stack, entity, player); 50 | } 51 | 52 | @Override 53 | public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 54 | 55 | return ServerHelper.isClientWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; 56 | } 57 | 58 | @Override 59 | public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) { 60 | 61 | if (stack.getItemDamage() > 0) { 62 | stack.setItemDamage(0); 63 | } 64 | if (!player.capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 65 | return EnumActionResult.PASS; 66 | } 67 | IBlockState state = world.getBlockState(pos); 68 | Block block = state.getBlock(); 69 | 70 | if (world.isAirBlock(pos)) { 71 | return EnumActionResult.PASS; 72 | } 73 | PlayerInteractEvent.RightClickBlock event = new PlayerInteractEvent.RightClickBlock(player, hand, stack, pos, side, new Vec3d(hitX, hitY, hitZ)); 74 | if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY || event.getUseBlock() == Result.DENY || event.getUseItem() == Result.DENY) { 75 | return EnumActionResult.PASS; 76 | } 77 | if (ServerHelper.isServerWorld(world) && player.isSneaking() && block instanceof IDismantleable && ((IDismantleable) block).canDismantle(world, pos, state, player)) { 78 | ((IDismantleable) block).dismantleBlock(world, pos, state, player, false); 79 | if (!player.capabilities.isCreativeMode) { 80 | useEnergy(stack, false); 81 | } 82 | return EnumActionResult.SUCCESS; 83 | } else if (ItemWrenchRF.handleIC2Tile(this, stack, player, world, pos, side.ordinal())) { 84 | return ServerHelper.isServerWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; 85 | } 86 | if (BlockHelper.canRotate(block)) { 87 | world.setBlockState(pos, BlockHelper.rotateVanillaBlock(world, state, pos), 3); 88 | if (!player.capabilities.isCreativeMode) { 89 | useEnergy(stack, false); 90 | } 91 | player.swingArm(hand); 92 | return ServerHelper.isServerWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; 93 | } else if (!player.isSneaking() && block.rotateBlock(world, pos, side)) { 94 | if (!player.capabilities.isCreativeMode) { 95 | useEnergy(stack, false); 96 | } 97 | player.swingArm(hand); 98 | return ServerHelper.isServerWorld(world) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; 99 | } 100 | return EnumActionResult.PASS; 101 | } 102 | 103 | /* IToolHammer */ 104 | @Override 105 | public boolean isUsable(ItemStack item, EntityLivingBase user, BlockPos pos) { 106 | 107 | if (user instanceof EntityPlayer) { 108 | if (((EntityPlayer) user).capabilities.isCreativeMode) { 109 | return true; 110 | } 111 | } 112 | return getEnergyStored(item) >= getEnergyPerUse(item); 113 | } 114 | 115 | @Override 116 | public boolean isUsable(ItemStack item, EntityLivingBase user, Entity entity) { 117 | 118 | if (user instanceof EntityPlayer) { 119 | if (((EntityPlayer) user).capabilities.isCreativeMode) { 120 | return true; 121 | } 122 | } 123 | return getEnergyStored(item) >= getEnergyPerUse(item); 124 | } 125 | 126 | @Override 127 | public void toolUsed(ItemStack item, EntityLivingBase user, BlockPos pos) { 128 | 129 | if (user instanceof EntityPlayer) { 130 | EntityPlayer player = (EntityPlayer) user; 131 | if (!player.capabilities.isCreativeMode) { 132 | useEnergy(player.getHeldItemMainhand(), false); 133 | } 134 | } 135 | } 136 | 137 | @Override 138 | public void toolUsed(ItemStack item, EntityLivingBase user, Entity entity) { 139 | 140 | if (user instanceof EntityPlayer) { 141 | EntityPlayer player = (EntityPlayer) user; 142 | if (!player.capabilities.isCreativeMode) { 143 | useEnergy(player.getHeldItemMainhand(), false); 144 | } 145 | } 146 | } 147 | 148 | /* IMPLEMENTABLES */ 149 | 150 | /* IToolCrowbar */ 151 | public boolean canWhack(EntityPlayer player, EnumHand hand, ItemStack crowbar, BlockPos pos) { 152 | 153 | return getEnergyStored(crowbar) >= getEnergyPerUse(crowbar) || player.capabilities.isCreativeMode; 154 | } 155 | 156 | public void onWhack(EntityPlayer player, EnumHand hand, ItemStack crowbar, BlockPos pos) { 157 | 158 | if (!player.capabilities.isCreativeMode) { 159 | useEnergy(crowbar, false); 160 | } 161 | player.swingArm(EnumHand.MAIN_HAND); 162 | } 163 | 164 | public boolean canLink(EntityPlayer player, EnumHand hand, ItemStack crowbar, EntityMinecart cart) { 165 | 166 | return player.isSneaking() && getEnergyStored(crowbar) >= getEnergyPerUse(crowbar) || player.capabilities.isCreativeMode; 167 | } 168 | 169 | public void onLink(EntityPlayer player, EnumHand hand, ItemStack crowbar, EntityMinecart cart) { 170 | 171 | if (!player.capabilities.isCreativeMode) { 172 | useEnergy(crowbar, false); 173 | } 174 | player.swingArm(EnumHand.MAIN_HAND); 175 | } 176 | 177 | public boolean canBoost(EntityPlayer player, EnumHand hand, ItemStack crowbar, EntityMinecart cart) { 178 | 179 | return !player.isSneaking() && getEnergyStored(crowbar) >= getEnergyPerUse(crowbar); 180 | } 181 | 182 | public void onBoost(EntityPlayer player, EnumHand hand, ItemStack crowbar, EntityMinecart cart) { 183 | 184 | if (!player.capabilities.isCreativeMode) { 185 | useEnergy(crowbar, false); 186 | } 187 | player.swingArm(EnumHand.MAIN_HAND); 188 | } 189 | 190 | /* IToolWrench */ 191 | public boolean canWrench(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace) { 192 | 193 | ItemStack stack = player.getHeldItemMainhand(); 194 | return getEnergyStored(stack) >= getEnergyPerUse(stack) || player.capabilities.isCreativeMode; 195 | } 196 | 197 | public void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace) { 198 | 199 | if (!player.capabilities.isCreativeMode) { 200 | useEnergy(player.getHeldItemMainhand(), false); 201 | } 202 | } 203 | 204 | } 205 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemBowRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.api.item.IMultiModeItem; 5 | import cofh.core.item.tool.ItemBowCore; 6 | import cofh.lib.util.helpers.EnergyHelper; 7 | import cofh.lib.util.helpers.ItemHelper; 8 | import cofh.lib.util.helpers.MathHelper; 9 | import cofh.lib.util.helpers.StringHelper; 10 | import cofh.redstonearsenal.init.RAProps; 11 | import net.minecraft.creativetab.CreativeTabs; 12 | import net.minecraft.enchantment.EnchantmentHelper; 13 | import net.minecraft.entity.Entity; 14 | import net.minecraft.entity.player.EntityPlayer; 15 | import net.minecraft.init.Enchantments; 16 | import net.minecraft.init.SoundEvents; 17 | import net.minecraft.item.EnumRarity; 18 | import net.minecraft.item.Item; 19 | import net.minecraft.item.ItemStack; 20 | import net.minecraft.nbt.NBTTagCompound; 21 | import net.minecraft.util.*; 22 | import net.minecraft.world.World; 23 | import net.minecraftforge.fml.relauncher.Side; 24 | import net.minecraftforge.fml.relauncher.SideOnly; 25 | 26 | import javax.annotation.Nonnull; 27 | import java.util.List; 28 | 29 | public class ItemBowRF extends ItemBowCore implements IMultiModeItem, IEnergyContainerItem { 30 | 31 | protected int maxEnergy = 160000; 32 | protected int maxTransfer = 1600; 33 | 34 | protected int energyPerUse = 200; 35 | protected int energyPerUseCharged = 800; 36 | 37 | public ItemBowRF(Item.ToolMaterial toolMaterial) { 38 | 39 | super(toolMaterial); 40 | setNoRepair(); 41 | 42 | addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> ItemBowRF.this.getEnergyStored(stack) > 0 && !ItemBowRF.this.isEmpowered(stack) ? 1F : 0F); 43 | addPropertyOverride(new ResourceLocation("empowered"), (stack, world, entity) -> ItemBowRF.this.isEmpowered(stack) ? 1F : 0F); 44 | } 45 | 46 | public ItemBowRF setEnergyParams(int maxEnergy, int maxTransfer, int energyPerUse, int energyPerUseCharged) { 47 | 48 | this.maxEnergy = maxEnergy; 49 | this.maxTransfer = maxTransfer; 50 | this.energyPerUse = energyPerUse; 51 | this.energyPerUseCharged = energyPerUseCharged; 52 | 53 | return this; 54 | } 55 | 56 | protected boolean isEmpowered(ItemStack stack) { 57 | 58 | return getMode(stack) == 1 && getEnergyStored(stack) > energyPerUseCharged; 59 | } 60 | 61 | protected int getEnergyPerUse(ItemStack stack) { 62 | 63 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 64 | return (isEmpowered(stack) ? energyPerUseCharged : energyPerUse) * (5 - unbreakingLevel) / 5; 65 | } 66 | 67 | @Override 68 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 69 | 70 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 71 | list.add(StringHelper.shiftForDetails()); 72 | } 73 | if (!StringHelper.isShiftKeyDown()) { 74 | return; 75 | } 76 | if (stack.getTagCompound() == null) { 77 | EnergyHelper.setDefaultEnergyTag(stack, 0); 78 | } 79 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 80 | 81 | list.add(StringHelper.ORANGE + getEnergyPerUse(stack) + " " + StringHelper.localize("info.redstonearsenal.tool.energyPerUse") + StringHelper.END); 82 | RAProps.addEmpoweredTip(this, stack, list); 83 | } 84 | 85 | @Override 86 | @SideOnly (Side.CLIENT) 87 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 88 | 89 | if (showInCreative) { 90 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), 0)); 91 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), maxEnergy)); 92 | } 93 | } 94 | 95 | @Override 96 | public void onBowFired(EntityPlayer player, ItemStack stack) { 97 | 98 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 99 | extractEnergy(stack, isEmpowered(stack) ? energyPerUseCharged * (5 - unbreakingLevel) / 5 : energyPerUse * (5 - unbreakingLevel) / 5, player.capabilities.isCreativeMode); 100 | 101 | boolean fired = stack.getTagCompound().getBoolean("Fired"); 102 | stack.getTagCompound().setBoolean("Fired", !fired); 103 | } 104 | 105 | @Override 106 | public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { 107 | 108 | if (stack.getItemDamage() > 0) { 109 | stack.setItemDamage(0); 110 | } 111 | } 112 | 113 | @Override 114 | public void setDamage(ItemStack stack, int damage) { 115 | 116 | super.setDamage(stack, 0); 117 | } 118 | 119 | @Override 120 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 121 | 122 | return false; 123 | } 124 | 125 | @Override 126 | public boolean isDamaged(ItemStack stack) { 127 | 128 | return true; 129 | } 130 | 131 | @Override 132 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 133 | 134 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 135 | } 136 | 137 | @Override 138 | public boolean showDurabilityBar(ItemStack stack) { 139 | 140 | return RAProps.showToolCharge && stack.getTagCompound() != null && !stack.getTagCompound().getBoolean("CreativeTab"); 141 | } 142 | 143 | @Override 144 | public int getMaxDamage(ItemStack stack) { 145 | 146 | return 0; 147 | } 148 | 149 | @Override 150 | public double getDurabilityForDisplay(ItemStack stack) { 151 | 152 | if (stack.getTagCompound() == null) { 153 | EnergyHelper.setDefaultEnergyTag(stack, 0); 154 | } 155 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 156 | } 157 | 158 | @Override 159 | public EnumRarity getRarity(ItemStack stack) { 160 | 161 | return isEmpowered(stack) ? EnumRarity.RARE : EnumRarity.UNCOMMON; 162 | } 163 | 164 | @Override 165 | public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { 166 | 167 | if (!player.capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 168 | return new ActionResult(EnumActionResult.FAIL, stack); 169 | } 170 | return super.onItemRightClick(stack, world, player, hand); 171 | } 172 | 173 | /* IMultiModeItem */ 174 | @Override 175 | public int getMode(ItemStack stack) { 176 | 177 | return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Mode"); 178 | } 179 | 180 | @Override 181 | public boolean setMode(ItemStack stack, int mode) { 182 | 183 | if (!stack.hasTagCompound()) { 184 | stack.setTagCompound(new NBTTagCompound()); 185 | } 186 | stack.getTagCompound().setInteger("Mode", mode); 187 | return false; 188 | } 189 | 190 | @Override 191 | public boolean incrMode(ItemStack stack) { 192 | 193 | if (!stack.hasTagCompound()) { 194 | stack.setTagCompound(new NBTTagCompound()); 195 | } 196 | int curMode = getMode(stack); 197 | curMode++; 198 | if (curMode >= getNumModes(stack)) { 199 | curMode = 0; 200 | } 201 | stack.getTagCompound().setInteger("Mode", curMode); 202 | return true; 203 | } 204 | 205 | @Override 206 | public boolean decrMode(ItemStack stack) { 207 | 208 | if (!stack.hasTagCompound()) { 209 | stack.setTagCompound(new NBTTagCompound()); 210 | } 211 | int curMode = getMode(stack); 212 | curMode--; 213 | if (curMode <= 0) { 214 | curMode = getNumModes(stack) - 1; 215 | } 216 | stack.getTagCompound().setInteger("Mode", curMode); 217 | return true; 218 | } 219 | 220 | @Override 221 | public int getNumModes(ItemStack stack) { 222 | 223 | return 2; 224 | } 225 | 226 | @Override 227 | public void onModeChange(EntityPlayer player, ItemStack stack) { 228 | 229 | if (isEmpowered(stack)) { 230 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_LIGHTNING_THUNDER, SoundCategory.PLAYERS, 0.4F, 1.0F); 231 | } else { 232 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_TOUCH, SoundCategory.PLAYERS, 0.2F, 0.6F); 233 | } 234 | } 235 | 236 | /* IEnergyContainerItem */ 237 | @Override 238 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 239 | 240 | if (container.getTagCompound() == null) { 241 | EnergyHelper.setDefaultEnergyTag(container, 0); 242 | } 243 | int stored = container.getTagCompound().getInteger("Energy"); 244 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 245 | 246 | if (!simulate) { 247 | stored += receive; 248 | container.getTagCompound().setInteger("Energy", stored); 249 | } 250 | return receive; 251 | } 252 | 253 | @Override 254 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 255 | 256 | if (container.getTagCompound() == null) { 257 | EnergyHelper.setDefaultEnergyTag(container, 0); 258 | } 259 | if (container.getTagCompound().hasKey("Unbreakable")) { 260 | container.getTagCompound().removeTag("Unbreakable"); 261 | } 262 | int stored = container.getTagCompound().getInteger("Energy"); 263 | int extract = Math.min(maxExtract, stored); 264 | 265 | if (!simulate) { 266 | stored -= extract; 267 | container.getTagCompound().setInteger("Energy", stored); 268 | 269 | if (stored == 0) { 270 | setMode(container, 0); 271 | } 272 | } 273 | return extract; 274 | } 275 | 276 | @Override 277 | public int getEnergyStored(ItemStack container) { 278 | 279 | if (container.getTagCompound() == null) { 280 | EnergyHelper.setDefaultEnergyTag(container, 0); 281 | } 282 | return container.getTagCompound().getInteger("Energy"); 283 | } 284 | 285 | @Override 286 | public int getMaxEnergyStored(ItemStack container) { 287 | 288 | return maxEnergy; 289 | } 290 | 291 | } 292 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemShovelRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.lib.util.helpers.MathHelper; 4 | import cofh.lib.util.helpers.ServerHelper; 5 | import cofh.lib.util.helpers.StringHelper; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.block.BlockDirt; 8 | import net.minecraft.block.material.Material; 9 | import net.minecraft.block.state.IBlockState; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.init.Blocks; 12 | import net.minecraft.init.SoundEvents; 13 | import net.minecraft.item.ItemSpade; 14 | import net.minecraft.item.ItemStack; 15 | import net.minecraft.util.EnumActionResult; 16 | import net.minecraft.util.EnumFacing; 17 | import net.minecraft.util.EnumHand; 18 | import net.minecraft.util.SoundCategory; 19 | import net.minecraft.util.math.BlockPos; 20 | import net.minecraft.world.World; 21 | import net.minecraftforge.common.MinecraftForge; 22 | import net.minecraftforge.event.entity.player.UseHoeEvent; 23 | import net.minecraftforge.fml.common.eventhandler.Event.Result; 24 | 25 | import java.util.List; 26 | 27 | public class ItemShovelRF extends ItemToolRF { 28 | 29 | int range = 5; 30 | 31 | public ItemShovelRF(ToolMaterial toolMaterial) { 32 | 33 | super(-3.0F, toolMaterial); 34 | addToolClass("shovel"); 35 | damage = 3; 36 | energyPerUseCharged = 800; 37 | 38 | effectiveBlocks.addAll(ItemSpade.EFFECTIVE_ON); 39 | 40 | effectiveMaterials.add(Material.GROUND); 41 | effectiveMaterials.add(Material.GRASS); 42 | effectiveMaterials.add(Material.SAND); 43 | effectiveMaterials.add(Material.SNOW); 44 | effectiveMaterials.add(Material.CRAFTED_SNOW); 45 | effectiveMaterials.add(Material.CLAY); 46 | } 47 | 48 | protected boolean hoeBlock(World world, int x, int y, int z, int hitSide, EntityPlayer player) { 49 | 50 | if (hitSide == 0) { 51 | return false; 52 | } 53 | BlockPos pos = new BlockPos(x, y, z); 54 | IBlockState state = world.getBlockState(pos); 55 | Block block = state.getBlock(); 56 | 57 | if (world.isAirBlock(pos.up())) { 58 | if (block == Blocks.GRASS || block == Blocks.GRASS_PATH) { 59 | world.playSound(player, pos, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F); 60 | if (ServerHelper.isServerWorld(world)) { 61 | world.setBlockState(pos, Blocks.FARMLAND.getDefaultState()); 62 | } 63 | return true; 64 | } 65 | if (block == Blocks.DIRT) { 66 | switch (state.getValue(BlockDirt.VARIANT)) { 67 | case DIRT: 68 | if (ServerHelper.isServerWorld(world)) { 69 | world.setBlockState(pos, Blocks.FARMLAND.getDefaultState()); 70 | } 71 | return true; 72 | case COARSE_DIRT: 73 | if (ServerHelper.isServerWorld(world)) { 74 | world.setBlockState(pos, Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); 75 | } 76 | return true; 77 | } 78 | } 79 | } 80 | return false; 81 | } 82 | 83 | protected boolean makePath(World world, int x, int y, int z, int hitSide, EntityPlayer player) { 84 | 85 | if (hitSide == 0) { 86 | return false; 87 | } 88 | BlockPos pos = new BlockPos(x, y, z); 89 | IBlockState state = world.getBlockState(pos); 90 | Block block = state.getBlock(); 91 | 92 | if (world.isAirBlock(pos.up()) && block == Blocks.GRASS) { 93 | world.playSound(player, pos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F); 94 | 95 | if (ServerHelper.isServerWorld(world)) { 96 | world.setBlockState(pos, Blocks.GRASS_PATH.getDefaultState(), 11); 97 | } 98 | return true; 99 | } 100 | return false; 101 | } 102 | 103 | protected Block getBlockFromPos(World world, int x, int y, int z) { 104 | 105 | return world.getBlockState(new BlockPos(x, y, z)).getBlock(); 106 | } 107 | 108 | @Override 109 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 110 | 111 | super.addInformation(stack, player, list, check); 112 | if (!StringHelper.isShiftKeyDown()) { 113 | return; 114 | } 115 | list.add(StringHelper.getFlavorText("info.redstonearsenal.tool.shovel")); 116 | } 117 | 118 | @Override 119 | public boolean canHarvestBlock(IBlockState state) { 120 | 121 | return state.getBlock() == Blocks.SNOW_LAYER ? true : state.getBlock() == Blocks.SNOW; 122 | } 123 | 124 | @Override 125 | public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { 126 | 127 | World world = player.worldObj; 128 | IBlockState state = world.getBlockState(pos); 129 | 130 | if (state.getBlockHardness(world, pos) == 0.0D) { 131 | return false; 132 | } 133 | Block block = state.getBlock(); 134 | 135 | int x = pos.getX(); 136 | int y = pos.getY(); 137 | int z = pos.getZ(); 138 | 139 | if (getEffectiveBlocks(stack).contains(block) && isEmpowered(stack)) { 140 | int facing = MathHelper.floor(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; 141 | switch (facing) { 142 | case 0: 143 | for (int i = ++z; i < z + range; i++) { 144 | if (!getEffectiveBlocks(stack).contains(getBlockFromPos(world, x, y, i))) { 145 | break; 146 | } 147 | if (!harvestBlock(world, new BlockPos(x, y, i), player)) { 148 | break; 149 | } 150 | } 151 | break; 152 | case 1: 153 | for (int i = --x; i > x - range; i--) { 154 | if (!getEffectiveBlocks(stack).contains(getBlockFromPos(world, i, y, z))) { 155 | break; 156 | } 157 | if (!harvestBlock(world, new BlockPos(i, y, z), player)) { 158 | break; 159 | } 160 | } 161 | break; 162 | case 2: 163 | for (int i = --z; i > z - range; i--) { 164 | if (!getEffectiveBlocks(stack).contains(getBlockFromPos(world, x, y, i))) { 165 | break; 166 | } 167 | if (!harvestBlock(world, new BlockPos(x, y, i), player)) { 168 | break; 169 | } 170 | } 171 | break; 172 | case 3: 173 | for (int i = ++x; i < x + range; i++) { 174 | if (!getEffectiveBlocks(stack).contains(getBlockFromPos(world, i, y, z))) { 175 | break; 176 | } 177 | if (!harvestBlock(world, new BlockPos(i, y, z), player)) { 178 | break; 179 | } 180 | } 181 | break; 182 | } 183 | } 184 | if (!player.capabilities.isCreativeMode) { 185 | useEnergy(stack, false); 186 | } 187 | return false; 188 | } 189 | 190 | public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 191 | 192 | if (!player.canPlayerEdit(pos, facing, stack) || !player.capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 193 | return EnumActionResult.FAIL; 194 | } 195 | EnumActionResult used = EnumActionResult.FAIL; 196 | 197 | if (player.isSneaking()) { 198 | UseHoeEvent event = new UseHoeEvent(player, stack, world, pos); 199 | 200 | if (MinecraftForge.EVENT_BUS.post(event)) { 201 | return EnumActionResult.FAIL; 202 | } 203 | if (event.getResult() == Result.ALLOW) { 204 | if (!player.capabilities.isCreativeMode) { 205 | useEnergy(stack, false); 206 | } 207 | return EnumActionResult.SUCCESS; 208 | } 209 | int x = pos.getX(); 210 | int y = pos.getY(); 211 | int z = pos.getZ(); 212 | 213 | int effRange = 1; 214 | if (isEmpowered(stack)) { 215 | effRange = range; 216 | } 217 | int hitVec = MathHelper.floor(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; 218 | 219 | switch (hitVec) { 220 | case 0: 221 | for (int i = z; i < z + effRange; i++) { 222 | if (!hoeBlock(world, x, y, i, facing.ordinal(), player)) { 223 | break; 224 | } 225 | used = EnumActionResult.SUCCESS; 226 | } 227 | break; 228 | case 1: 229 | for (int i = x; i > x - effRange; i--) { 230 | if (!hoeBlock(world, i, y, z, facing.ordinal(), player)) { 231 | break; 232 | } 233 | used = EnumActionResult.SUCCESS; 234 | } 235 | break; 236 | case 2: 237 | for (int i = z; i > z - effRange; i--) { 238 | if (!hoeBlock(world, x, y, i, facing.ordinal(), player)) { 239 | break; 240 | } 241 | used = EnumActionResult.SUCCESS; 242 | } 243 | break; 244 | case 3: 245 | for (int i = x; i < x + effRange; i++) { 246 | if (!hoeBlock(world, i, y, z, facing.ordinal(), player)) { 247 | break; 248 | } 249 | used = EnumActionResult.SUCCESS; 250 | } 251 | break; 252 | } 253 | } else { 254 | int x = pos.getX(); 255 | int y = pos.getY(); 256 | int z = pos.getZ(); 257 | 258 | int effRange = 1; 259 | if (isEmpowered(stack)) { 260 | effRange = range; 261 | } 262 | int hitVec = MathHelper.floor(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; 263 | 264 | switch (hitVec) { 265 | case 0: 266 | for (int i = z; i < z + effRange; i++) { 267 | if (!makePath(world, x, y, i, facing.ordinal(), player)) { 268 | break; 269 | } 270 | used = EnumActionResult.SUCCESS; 271 | } 272 | break; 273 | case 1: 274 | for (int i = x; i > x - effRange; i--) { 275 | if (!makePath(world, i, y, z, facing.ordinal(), player)) { 276 | break; 277 | } 278 | used = EnumActionResult.SUCCESS; 279 | } 280 | break; 281 | case 2: 282 | for (int i = z; i > z - effRange; i--) { 283 | if (!makePath(world, x, y, i, facing.ordinal(), player)) { 284 | break; 285 | } 286 | used = EnumActionResult.SUCCESS; 287 | } 288 | break; 289 | case 3: 290 | for (int i = x; i < x + effRange; i++) { 291 | if (!makePath(world, i, y, z, facing.ordinal(), player)) { 292 | break; 293 | } 294 | used = EnumActionResult.SUCCESS; 295 | } 296 | break; 297 | } 298 | } 299 | if (used == EnumActionResult.SUCCESS && !player.capabilities.isCreativeMode) { 300 | useEnergy(stack, false); 301 | } 302 | return used; 303 | } 304 | 305 | } 306 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/block/BlockStorage.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.block; 2 | 3 | import cofh.core.block.BlockCore; 4 | import cofh.core.render.IModelRegister; 5 | import cofh.core.util.core.IInitializer; 6 | import cofh.lib.util.helpers.DamageHelper; 7 | import cofh.lib.util.helpers.EnergyHelper; 8 | import cofh.redstonearsenal.RedstoneArsenal; 9 | import net.minecraft.block.SoundType; 10 | import net.minecraft.block.material.Material; 11 | import net.minecraft.block.properties.IProperty; 12 | import net.minecraft.block.properties.PropertyEnum; 13 | import net.minecraft.block.state.BlockStateContainer; 14 | import net.minecraft.block.state.IBlockState; 15 | import net.minecraft.client.renderer.block.model.ModelResourceLocation; 16 | import net.minecraft.creativetab.CreativeTabs; 17 | import net.minecraft.entity.Entity; 18 | import net.minecraft.entity.player.EntityPlayerMP; 19 | import net.minecraft.item.EnumRarity; 20 | import net.minecraft.item.Item; 21 | import net.minecraft.item.ItemStack; 22 | import net.minecraft.util.IStringSerializable; 23 | import net.minecraft.util.math.AxisAlignedBB; 24 | import net.minecraft.util.math.BlockPos; 25 | import net.minecraft.world.Explosion; 26 | import net.minecraft.world.IBlockAccess; 27 | import net.minecraft.world.World; 28 | import net.minecraftforge.client.model.ModelLoader; 29 | import net.minecraftforge.fml.common.registry.GameRegistry; 30 | import net.minecraftforge.fml.relauncher.Side; 31 | import net.minecraftforge.fml.relauncher.SideOnly; 32 | 33 | import javax.annotation.Nonnull; 34 | import java.util.List; 35 | import java.util.Locale; 36 | 37 | import static cofh.lib.util.helpers.ItemHelper.addStorageRecipe; 38 | import static cofh.lib.util.helpers.ItemHelper.registerWithHandlers; 39 | 40 | public class BlockStorage extends BlockCore implements IInitializer, IModelRegister { 41 | 42 | public static final PropertyEnum VARIANT = PropertyEnum.create("type", BlockStorage.Type.class); 43 | 44 | // TODO: Review if this should be optional. 45 | // static final boolean[] ENABLE_CHARGE = new boolean[2]; 46 | // static final boolean[] ENABLE_DAMAGE = new boolean[2]; 47 | // static final int[] CHARGE = new int[2]; 48 | // static final double[] DAMAGE = new double[2]; 49 | static final AxisAlignedBB COLLISION_AABB = new AxisAlignedBB(0.00390625D, 0.00390625D, 0.00390625D, 0.99609375D, 0.99609375D, 0.99609375D); 50 | 51 | public BlockStorage() { 52 | 53 | super(Material.IRON, "redstonearsenal"); 54 | 55 | setUnlocalizedName("storage"); 56 | setCreativeTab(RedstoneArsenal.tabCommon); 57 | 58 | setHardness(25.0F); 59 | setResistance(120.0F); 60 | setSoundType(SoundType.METAL); 61 | setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, Type.ELECTRUM_FLUX)); 62 | 63 | setHarvestLevel("pickaxe", 2); 64 | } 65 | 66 | @Override 67 | protected BlockStateContainer createBlockState() { 68 | 69 | return new BlockStateContainer(this, new IProperty[] { VARIANT }); 70 | } 71 | 72 | @Override 73 | @SideOnly (Side.CLIENT) 74 | public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { 75 | 76 | for (int i = 0; i < Type.METADATA_LOOKUP.length; i++) { 77 | list.add(new ItemStack(item, 1, i)); 78 | } 79 | } 80 | 81 | /* TYPE METHODS */ 82 | @Override 83 | public IBlockState getStateFromMeta(int meta) { 84 | 85 | return this.getDefaultState().withProperty(VARIANT, BlockStorage.Type.byMetadata(meta)); 86 | } 87 | 88 | @Override 89 | public int getMetaFromState(IBlockState state) { 90 | 91 | return state.getValue(VARIANT).getMetadata(); 92 | } 93 | 94 | @Override 95 | public int damageDropped(IBlockState state) { 96 | 97 | return state.getValue(VARIANT).getMetadata(); 98 | } 99 | 100 | /* BLOCK METHODS */ 101 | @Override 102 | public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { 103 | 104 | entity.attackEntityFrom(DamageHelper.flux, 2.0F); 105 | 106 | if (entity instanceof EntityPlayerMP) { 107 | EntityPlayerMP player = (EntityPlayerMP) entity; 108 | if (EnergyHelper.isPlayerHoldingEnergyContainerItem(player)) { 109 | EnergyHelper.insertEnergyIntoHeldContainer(player, 100, false); 110 | } 111 | } 112 | } 113 | 114 | @Override 115 | public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) { 116 | 117 | return false; 118 | } 119 | 120 | @Override 121 | public boolean canProvidePower(IBlockState state) { 122 | 123 | return true; 124 | } 125 | 126 | @Override 127 | public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon) { 128 | 129 | return true; 130 | } 131 | 132 | @Override 133 | public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) { 134 | 135 | return true; 136 | } 137 | 138 | @Override 139 | public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) { 140 | 141 | return Type.byMetadata(state.getBlock().getMetaFromState(state)).light; 142 | } 143 | 144 | @Override 145 | public float getBlockHardness(IBlockState state, World world, BlockPos pos) { 146 | 147 | return Type.byMetadata(state.getBlock().getMetaFromState(state)).hardness; 148 | } 149 | 150 | @Override 151 | public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { 152 | 153 | IBlockState state = world.getBlockState(pos); 154 | return Type.byMetadata(state.getBlock().getMetaFromState(state)).resistance; 155 | } 156 | 157 | @Override 158 | public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { 159 | 160 | return COLLISION_AABB; 161 | } 162 | 163 | /* IModelRegister */ 164 | @Override 165 | @SideOnly (Side.CLIENT) 166 | public void registerModels() { 167 | 168 | for (int i = 0; i < Type.values().length; i++) { 169 | ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), i, new ModelResourceLocation(modName + ":" + name, "type=" + Type.byMetadata(i).getName())); 170 | } 171 | } 172 | 173 | /* IInitializer */ 174 | @Override 175 | public boolean preInit() { 176 | 177 | this.setRegistryName("storage"); 178 | GameRegistry.register(this); 179 | 180 | ItemBlockStorage itemBlock = new ItemBlockStorage(this); 181 | itemBlock.setRegistryName(this.getRegistryName()); 182 | GameRegistry.register(itemBlock); 183 | 184 | blockElectrumFlux = new ItemStack(this, 1, Type.ELECTRUM_FLUX.getMetadata()); 185 | blockCrystalFlux = new ItemStack(this, 1, Type.CRYSTAL_FLUX.getMetadata()); 186 | 187 | registerWithHandlers("blockElectrumFlux", blockElectrumFlux); 188 | registerWithHandlers("blockCrystalFlux", blockCrystalFlux); 189 | 190 | return true; 191 | } 192 | 193 | @Override 194 | public boolean initialize() { 195 | 196 | addStorageRecipe(blockElectrumFlux, "ingotElectrumFlux"); 197 | addStorageRecipe(blockCrystalFlux, "gemCrystalFlux"); 198 | 199 | return true; 200 | } 201 | 202 | @Override 203 | public boolean postInit() { 204 | 205 | return true; 206 | } 207 | 208 | /* TYPE */ 209 | public enum Type implements IStringSerializable { 210 | 211 | // @formatter:off 212 | ELECTRUM_FLUX(0, "electrumFlux", blockElectrumFlux, 7), 213 | CRYSTAL_FLUX(1, "crystalFlux", blockCrystalFlux, 7); 214 | // @formatter: on 215 | 216 | private static final BlockStorage.Type[] METADATA_LOOKUP = new BlockStorage.Type[values().length]; 217 | private final int metadata; 218 | private final String name; 219 | private final ItemStack stack; 220 | 221 | private final int light; 222 | private final float hardness; 223 | private final float resistance; 224 | private final EnumRarity rarity; 225 | 226 | Type(int metadata, String name, ItemStack stack, int light, float hardness, float resistance, EnumRarity rarity) { 227 | 228 | this.metadata = metadata; 229 | this.name = name; 230 | this.stack = stack; 231 | 232 | this.light = light; 233 | this.hardness = hardness; 234 | this.resistance = resistance; 235 | this.rarity = rarity; 236 | } 237 | 238 | Type(int metadata, String name, ItemStack stack, int light, float hardness, float resistance) { 239 | 240 | this(metadata, name, stack, light, hardness, resistance, EnumRarity.UNCOMMON); 241 | } 242 | 243 | Type(int metadata, String name, ItemStack stack, float hardness, float resistance) { 244 | this(metadata, name, stack, 0, hardness, resistance, EnumRarity.UNCOMMON); 245 | } 246 | 247 | Type(int metadata, String name, ItemStack stack, int light) { 248 | 249 | this(metadata, name, stack, light, 25.0F, 120.0F, EnumRarity.UNCOMMON); 250 | } 251 | 252 | Type(int metadata, String name, ItemStack stack) { 253 | 254 | this(metadata, name, stack, 0, 25.0F, 120.0F, EnumRarity.UNCOMMON); 255 | } 256 | 257 | public int getMetadata() { 258 | return this.metadata; 259 | } 260 | 261 | @Override 262 | public String getName() { 263 | 264 | return this.name.toLowerCase(Locale.US); 265 | } 266 | 267 | public String getNameRaw() { 268 | 269 | return this.name; 270 | } 271 | 272 | public ItemStack getStack() { 273 | 274 | return this.stack; 275 | } 276 | 277 | public int getLight() { 278 | 279 | return this.light; 280 | } 281 | 282 | public float getHardness() { 283 | 284 | return this.hardness; 285 | } 286 | 287 | public float getResistance() { 288 | 289 | return this.resistance; 290 | } 291 | 292 | public EnumRarity getRarity() { 293 | 294 | return this.rarity; 295 | } 296 | 297 | public static Type byMetadata(int metadata) { 298 | 299 | if (metadata < 0 || metadata >= METADATA_LOOKUP.length) { 300 | metadata = 0; 301 | } 302 | return METADATA_LOOKUP[metadata]; 303 | } 304 | 305 | static { 306 | for (Type type : values()) { 307 | METADATA_LOOKUP[type.getMetadata()] = type; 308 | } 309 | } 310 | } 311 | 312 | /* REFERENCES */ 313 | public static ItemStack blockElectrumFlux; 314 | public static ItemStack blockCrystalFlux; 315 | 316 | } 317 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemFishingRodRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.api.item.IMultiModeItem; 5 | import cofh.core.entity.EntityFishHookCore; 6 | import cofh.core.item.tool.ItemFishingRodCore; 7 | import cofh.lib.util.helpers.*; 8 | import cofh.redstonearsenal.init.RAProps; 9 | import net.minecraft.creativetab.CreativeTabs; 10 | import net.minecraft.enchantment.EnchantmentHelper; 11 | import net.minecraft.entity.EntityLivingBase; 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.init.Enchantments; 14 | import net.minecraft.init.SoundEvents; 15 | import net.minecraft.item.EnumRarity; 16 | import net.minecraft.item.Item; 17 | import net.minecraft.item.ItemStack; 18 | import net.minecraft.nbt.NBTTagCompound; 19 | import net.minecraft.util.*; 20 | import net.minecraft.world.World; 21 | import net.minecraftforge.fml.relauncher.Side; 22 | import net.minecraftforge.fml.relauncher.SideOnly; 23 | 24 | import javax.annotation.Nonnull; 25 | import java.util.List; 26 | 27 | public class ItemFishingRodRF extends ItemFishingRodCore implements IMultiModeItem, IEnergyContainerItem { 28 | 29 | protected int maxEnergy = 160000; 30 | protected int maxTransfer = 1600; 31 | 32 | protected int energyPerUse = 200; 33 | protected int energyPerUseCharged = 800; 34 | 35 | public ItemFishingRodRF(ToolMaterial toolMaterial) { 36 | 37 | super(toolMaterial); 38 | setNoRepair(); 39 | 40 | addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> ItemFishingRodRF.this.getEnergyStored(stack) > 0 && !ItemFishingRodRF.this.isEmpowered(stack) ? 1F : 0F); 41 | addPropertyOverride(new ResourceLocation("empowered"), (stack, world, entity) -> ItemFishingRodRF.this.isEmpowered(stack) ? 1F : 0F); 42 | } 43 | 44 | public ItemFishingRodRF setEnergyParams(int maxEnergy, int maxTransfer, int energyPerUse, int energyPerUseCharged) { 45 | 46 | this.maxEnergy = maxEnergy; 47 | this.maxTransfer = maxTransfer; 48 | this.energyPerUse = energyPerUse; 49 | this.energyPerUseCharged = energyPerUseCharged; 50 | 51 | return this; 52 | } 53 | 54 | protected boolean isCastState(ItemStack stack, EntityLivingBase entity) { 55 | 56 | return (entity != null && entity.getHeldItemMainhand() == stack && entity instanceof EntityPlayer && ((EntityPlayer) entity).fishEntity != null); 57 | } 58 | 59 | protected boolean isEmpowered(ItemStack stack) { 60 | 61 | return getMode(stack) == 1 && getEnergyStored(stack) > energyPerUseCharged; 62 | } 63 | 64 | protected int getEnergyPerUse(ItemStack stack) { 65 | 66 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 67 | return (isEmpowered(stack) ? energyPerUseCharged : energyPerUse) * (5 - unbreakingLevel) / 5; 68 | } 69 | 70 | protected int useEnergy(ItemStack stack, boolean simulate) { 71 | 72 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 73 | return extractEnergy(stack, isEmpowered(stack) ? energyPerUseCharged * (5 - unbreakingLevel) / 5 : energyPerUse * (5 - unbreakingLevel) / 5, simulate); 74 | } 75 | 76 | @Override 77 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 78 | 79 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 80 | list.add(StringHelper.shiftForDetails()); 81 | } 82 | if (!StringHelper.isShiftKeyDown()) { 83 | return; 84 | } 85 | if (stack.getTagCompound() == null) { 86 | EnergyHelper.setDefaultEnergyTag(stack, 0); 87 | } 88 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 89 | 90 | list.add(StringHelper.ORANGE + getEnergyPerUse(stack) + " " + StringHelper.localize("info.redstonearsenal.tool.energyPerUse") + StringHelper.END); 91 | RAProps.addEmpoweredTip(this, stack, list); 92 | } 93 | 94 | @Override 95 | @SideOnly (Side.CLIENT) 96 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 97 | 98 | if (showInCreative) { 99 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), 0)); 100 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), maxEnergy)); 101 | } 102 | } 103 | 104 | @Override 105 | public void setDamage(ItemStack stack, int damage) { 106 | 107 | super.setDamage(stack, 0); 108 | } 109 | 110 | @Override 111 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 112 | 113 | return false; 114 | } 115 | 116 | @Override 117 | public boolean isDamaged(ItemStack stack) { 118 | 119 | return true; 120 | } 121 | 122 | @Override 123 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 124 | 125 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 126 | } 127 | 128 | @Override 129 | public boolean showDurabilityBar(ItemStack stack) { 130 | 131 | return RAProps.showToolCharge && stack.getTagCompound() != null && !stack.getTagCompound().getBoolean("CreativeTab"); 132 | } 133 | 134 | @Override 135 | public int getMaxDamage(ItemStack stack) { 136 | 137 | return 0; 138 | } 139 | 140 | @Override 141 | public double getDurabilityForDisplay(ItemStack stack) { 142 | 143 | if (stack.getTagCompound() == null) { 144 | EnergyHelper.setDefaultEnergyTag(stack, 0); 145 | } 146 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 147 | } 148 | 149 | @Override 150 | public EnumRarity getRarity(ItemStack stack) { 151 | 152 | return isEmpowered(stack) ? EnumRarity.RARE : EnumRarity.UNCOMMON; 153 | } 154 | 155 | @Override 156 | public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { 157 | 158 | if (!player.capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 159 | return new ActionResult<>(EnumActionResult.FAIL, stack); 160 | } 161 | if (player.fishEntity != null) { 162 | player.fishEntity.handleHookRetraction(); 163 | useEnergy(stack, false); 164 | } else { 165 | world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); 166 | 167 | if (ServerHelper.isServerWorld(world)) { 168 | if (isEmpowered(stack)) { 169 | world.spawnEntityInWorld(new EntityFishHookCore(world, player, luckModifier + 2, speedModifier + 2)); 170 | } else { 171 | world.spawnEntityInWorld(new EntityFishHookCore(world, player, luckModifier, speedModifier)); 172 | } 173 | 174 | } 175 | } 176 | player.swingArm(EnumHand.MAIN_HAND); 177 | return new ActionResult<>(EnumActionResult.PASS, stack); 178 | } 179 | 180 | /* IMultiModeItem */ 181 | @Override 182 | public int getMode(ItemStack stack) { 183 | 184 | return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Mode"); 185 | } 186 | 187 | @Override 188 | public boolean setMode(ItemStack stack, int mode) { 189 | 190 | if (!stack.hasTagCompound()) { 191 | stack.setTagCompound(new NBTTagCompound()); 192 | } 193 | stack.getTagCompound().setInteger("Mode", mode); 194 | return false; 195 | } 196 | 197 | @Override 198 | public boolean incrMode(ItemStack stack) { 199 | 200 | if (!stack.hasTagCompound()) { 201 | stack.setTagCompound(new NBTTagCompound()); 202 | } 203 | int curMode = getMode(stack); 204 | curMode++; 205 | if (curMode >= getNumModes(stack)) { 206 | curMode = 0; 207 | } 208 | stack.getTagCompound().setInteger("Mode", curMode); 209 | return true; 210 | } 211 | 212 | @Override 213 | public boolean decrMode(ItemStack stack) { 214 | 215 | if (!stack.hasTagCompound()) { 216 | stack.setTagCompound(new NBTTagCompound()); 217 | } 218 | int curMode = getMode(stack); 219 | curMode--; 220 | if (curMode <= 0) { 221 | curMode = getNumModes(stack) - 1; 222 | } 223 | stack.getTagCompound().setInteger("Mode", curMode); 224 | return true; 225 | } 226 | 227 | @Override 228 | public int getNumModes(ItemStack stack) { 229 | 230 | return 2; 231 | } 232 | 233 | @Override 234 | public void onModeChange(EntityPlayer player, ItemStack stack) { 235 | 236 | if (isEmpowered(stack)) { 237 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_LIGHTNING_THUNDER, SoundCategory.PLAYERS, 0.4F, 1.0F); 238 | } else { 239 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_TOUCH, SoundCategory.PLAYERS, 0.2F, 0.6F); 240 | } 241 | } 242 | 243 | /* IEnergyContainerItem */ 244 | @Override 245 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 246 | 247 | if (container.getTagCompound() == null) { 248 | EnergyHelper.setDefaultEnergyTag(container, 0); 249 | } 250 | int stored = container.getTagCompound().getInteger("Energy"); 251 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 252 | 253 | if (!simulate) { 254 | stored += receive; 255 | container.getTagCompound().setInteger("Energy", stored); 256 | } 257 | return receive; 258 | } 259 | 260 | @Override 261 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 262 | 263 | if (container.getTagCompound() == null) { 264 | EnergyHelper.setDefaultEnergyTag(container, 0); 265 | } 266 | if (container.getTagCompound().hasKey("Unbreakable")) { 267 | container.getTagCompound().removeTag("Unbreakable"); 268 | } 269 | int stored = container.getTagCompound().getInteger("Energy"); 270 | int extract = Math.min(maxExtract, stored); 271 | 272 | if (!simulate) { 273 | stored -= extract; 274 | container.getTagCompound().setInteger("Energy", stored); 275 | 276 | if (stored == 0) { 277 | setMode(container, 0); 278 | } 279 | } 280 | return extract; 281 | } 282 | 283 | @Override 284 | public int getEnergyStored(ItemStack container) { 285 | 286 | if (container.getTagCompound() == null) { 287 | EnergyHelper.setDefaultEnergyTag(container, 0); 288 | } 289 | return container.getTagCompound().getInteger("Energy"); 290 | } 291 | 292 | @Override 293 | public int getMaxEnergyStored(ItemStack container) { 294 | 295 | return maxEnergy; 296 | } 297 | 298 | } 299 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemShieldRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.api.item.IMultiModeItem; 5 | import cofh.core.item.tool.ItemShieldCore; 6 | import cofh.lib.util.helpers.EnergyHelper; 7 | import cofh.lib.util.helpers.ItemHelper; 8 | import cofh.lib.util.helpers.MathHelper; 9 | import cofh.lib.util.helpers.StringHelper; 10 | import cofh.redstonearsenal.init.RAProps; 11 | import net.minecraft.creativetab.CreativeTabs; 12 | import net.minecraft.enchantment.EnchantmentHelper; 13 | import net.minecraft.entity.Entity; 14 | import net.minecraft.entity.EntityLivingBase; 15 | import net.minecraft.entity.player.EntityPlayer; 16 | import net.minecraft.init.Enchantments; 17 | import net.minecraft.init.SoundEvents; 18 | import net.minecraft.item.EnumRarity; 19 | import net.minecraft.item.Item; 20 | import net.minecraft.item.ItemStack; 21 | import net.minecraft.nbt.NBTTagCompound; 22 | import net.minecraft.util.*; 23 | import net.minecraft.world.World; 24 | import net.minecraftforge.fml.relauncher.Side; 25 | import net.minecraftforge.fml.relauncher.SideOnly; 26 | 27 | import javax.annotation.Nonnull; 28 | import java.util.List; 29 | 30 | public class ItemShieldRF extends ItemShieldCore implements IMultiModeItem, IEnergyContainerItem { 31 | 32 | protected int maxEnergy = 160000; 33 | protected int maxTransfer = 1600; 34 | 35 | protected int energyPerUse = 25; 36 | protected int energyPerUseCharged = 100; 37 | 38 | public ItemShieldRF(ToolMaterial toolMaterial) { 39 | 40 | super(toolMaterial); 41 | setNoRepair(); 42 | 43 | addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> ItemShieldRF.this.getEnergyStored(stack) > 0 && !ItemShieldRF.this.isEmpowered(stack) ? 1F : 0F); 44 | addPropertyOverride(new ResourceLocation("empowered"), (stack, world, entity) -> ItemShieldRF.this.isEmpowered(stack) ? 1F : 0F); 45 | } 46 | 47 | public ItemShieldRF setEnergyParams(int maxEnergy, int maxTransfer, int energyPerUse) { 48 | 49 | this.maxEnergy = maxEnergy; 50 | this.maxTransfer = maxTransfer; 51 | this.energyPerUse = energyPerUse; 52 | 53 | return this; 54 | } 55 | 56 | public ItemShieldRF setShowInCreative(boolean showInCreative) { 57 | 58 | this.showInCreative = showInCreative; 59 | return this; 60 | } 61 | 62 | protected void pushEntityAway(Entity entity, Entity player) { 63 | 64 | double x = player.posX - entity.posX; 65 | double z = player.posZ - entity.posZ; 66 | double abs = MathHelper.maxAbs(x, z); 67 | 68 | if (abs >= 0.01D) { 69 | abs = Math.sqrt(abs); 70 | x /= abs; 71 | z /= abs; 72 | double factor = 1.0D / abs; 73 | 74 | if (factor > 1.0D) { 75 | factor = 1.0D; 76 | } 77 | x *= factor; 78 | z *= factor; 79 | x *= 0.2D; 80 | z *= 0.2D; 81 | x *= 1.0F - entity.entityCollisionReduction; 82 | z *= 1.0F - entity.entityCollisionReduction; 83 | entity.addVelocity(-x, 0.0D, -z); 84 | } 85 | } 86 | 87 | protected boolean isEmpowered(ItemStack stack) { 88 | 89 | return getMode(stack) == 1 && getEnergyStored(stack) > energyPerUseCharged; 90 | } 91 | 92 | protected int getEnergyPerUse(ItemStack stack) { 93 | 94 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 95 | return (isEmpowered(stack) ? energyPerUseCharged : energyPerUse) * (5 - unbreakingLevel) / 5; 96 | } 97 | 98 | protected int useEnergy(ItemStack stack, boolean simulate) { 99 | 100 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 101 | return extractEnergy(stack, isEmpowered(stack) ? energyPerUseCharged * (5 - unbreakingLevel) / 5 : energyPerUse * (5 - unbreakingLevel) / 5, simulate); 102 | } 103 | 104 | @Override 105 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 106 | 107 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 108 | list.add(StringHelper.shiftForDetails()); 109 | } 110 | if (!StringHelper.isShiftKeyDown()) { 111 | return; 112 | } 113 | if (stack.getTagCompound() == null) { 114 | EnergyHelper.setDefaultEnergyTag(stack, 0); 115 | } 116 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 117 | 118 | list.add(StringHelper.ORANGE + getEnergyPerUse(stack) + " " + StringHelper.localize("info.redstonearsenal.tool.energyPerUse") + StringHelper.END); 119 | } 120 | 121 | @Override 122 | @SideOnly (Side.CLIENT) 123 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 124 | 125 | if (showInCreative) { 126 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), 0)); 127 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), maxEnergy)); 128 | } 129 | } 130 | 131 | @Override 132 | public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { 133 | 134 | if (stack.getItemDamage() > 0) { 135 | stack.setItemDamage(0); 136 | } 137 | } 138 | 139 | @Override 140 | public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) { 141 | 142 | // if (!((EntityPlayer) player).capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 143 | // player.stopActiveHand(); 144 | // return; 145 | // } 146 | // if (isEmpowered(stack)) { 147 | // if (player.isActiveItemStackBlocking()) { 148 | // AxisAlignedBB axisAlignedBB = player.getEntityBoundingBox().expand(2.0D, 1.0D, 2.0D); 149 | // List list = player.worldObj.getEntitiesWithinAABB(EntityMob.class, axisAlignedBB); 150 | // 151 | // for (Entity mob : list) { 152 | // pushEntityAway(mob, player); 153 | // } 154 | // } 155 | // } 156 | // useEnergy(stack, false); 157 | } 158 | 159 | @Override 160 | public void setDamage(ItemStack stack, int damage) { 161 | 162 | super.setDamage(stack, 0); 163 | } 164 | 165 | @Override 166 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 167 | 168 | return false; 169 | } 170 | 171 | @Override 172 | public boolean isDamaged(ItemStack stack) { 173 | 174 | return true; 175 | } 176 | 177 | @Override 178 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 179 | 180 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 181 | } 182 | 183 | @Override 184 | public boolean showDurabilityBar(ItemStack stack) { 185 | 186 | return RAProps.showToolCharge && stack.getTagCompound() != null && !stack.getTagCompound().getBoolean("CreativeTab"); 187 | } 188 | 189 | @Override 190 | public int getMaxDamage(ItemStack stack) { 191 | 192 | return 0; 193 | } 194 | 195 | @Override 196 | public double getDurabilityForDisplay(ItemStack stack) { 197 | 198 | if (stack.getTagCompound() == null) { 199 | EnergyHelper.setDefaultEnergyTag(stack, 0); 200 | } 201 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 202 | } 203 | 204 | @Override 205 | public EnumRarity getRarity(ItemStack stack) { 206 | 207 | return EnumRarity.UNCOMMON; 208 | } 209 | 210 | @Override 211 | public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { 212 | 213 | if (!player.capabilities.isCreativeMode && getEnergyStored(stack) < getEnergyPerUse(stack)) { 214 | new ActionResult(EnumActionResult.FAIL, stack); 215 | } 216 | player.setActiveHand(hand); 217 | return new ActionResult(EnumActionResult.SUCCESS, stack); 218 | } 219 | 220 | /* IMultiModeItem */ 221 | @Override 222 | public int getMode(ItemStack stack) { 223 | 224 | return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Mode"); 225 | } 226 | 227 | @Override 228 | public boolean setMode(ItemStack stack, int mode) { 229 | 230 | if (!stack.hasTagCompound()) { 231 | stack.setTagCompound(new NBTTagCompound()); 232 | } 233 | stack.getTagCompound().setInteger("Mode", mode); 234 | return false; 235 | } 236 | 237 | @Override 238 | public boolean incrMode(ItemStack stack) { 239 | 240 | if (!stack.hasTagCompound()) { 241 | stack.setTagCompound(new NBTTagCompound()); 242 | } 243 | int curMode = getMode(stack); 244 | curMode++; 245 | if (curMode >= getNumModes(stack)) { 246 | curMode = 0; 247 | } 248 | stack.getTagCompound().setInteger("Mode", curMode); 249 | return true; 250 | } 251 | 252 | @Override 253 | public boolean decrMode(ItemStack stack) { 254 | 255 | if (!stack.hasTagCompound()) { 256 | stack.setTagCompound(new NBTTagCompound()); 257 | } 258 | int curMode = getMode(stack); 259 | curMode--; 260 | if (curMode <= 0) { 261 | curMode = getNumModes(stack) - 1; 262 | } 263 | stack.getTagCompound().setInteger("Mode", curMode); 264 | return true; 265 | } 266 | 267 | @Override 268 | public int getNumModes(ItemStack stack) { 269 | 270 | return 2; 271 | } 272 | 273 | @Override 274 | public void onModeChange(EntityPlayer player, ItemStack stack) { 275 | 276 | if (isEmpowered(stack)) { 277 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_LIGHTNING_THUNDER, SoundCategory.PLAYERS, 0.4F, 1.0F); 278 | } else { 279 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_TOUCH, SoundCategory.PLAYERS, 0.2F, 0.6F); 280 | } 281 | } 282 | 283 | /* IEnergyContainerItem */ 284 | @Override 285 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 286 | 287 | if (container.getTagCompound() == null) { 288 | EnergyHelper.setDefaultEnergyTag(container, 0); 289 | } 290 | int stored = container.getTagCompound().getInteger("Energy"); 291 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 292 | 293 | if (!simulate) { 294 | stored += receive; 295 | container.getTagCompound().setInteger("Energy", stored); 296 | } 297 | return receive; 298 | } 299 | 300 | @Override 301 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 302 | 303 | if (container.getTagCompound() == null) { 304 | EnergyHelper.setDefaultEnergyTag(container, 0); 305 | } 306 | if (container.getTagCompound().hasKey("Unbreakable")) { 307 | container.getTagCompound().removeTag("Unbreakable"); 308 | } 309 | int stored = container.getTagCompound().getInteger("Energy"); 310 | int extract = Math.min(maxExtract, stored); 311 | 312 | if (!simulate) { 313 | stored -= extract; 314 | container.getTagCompound().setInteger("Energy", stored); 315 | 316 | if (stored == 0) { 317 | setMode(container, 0); 318 | } 319 | } 320 | return extract; 321 | } 322 | 323 | @Override 324 | public int getEnergyStored(ItemStack container) { 325 | 326 | if (container.getTagCompound() == null) { 327 | EnergyHelper.setDefaultEnergyTag(container, 0); 328 | } 329 | return container.getTagCompound().getInteger("Energy"); 330 | } 331 | 332 | @Override 333 | public int getMaxEnergyStored(ItemStack container) { 334 | 335 | return maxEnergy; 336 | } 337 | 338 | } 339 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemSwordRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.api.item.IMultiModeItem; 5 | import cofh.lib.util.helpers.*; 6 | import cofh.redstonearsenal.init.RAProps; 7 | import com.google.common.collect.HashMultimap; 8 | import com.google.common.collect.Multimap; 9 | import net.minecraft.block.state.IBlockState; 10 | import net.minecraft.creativetab.CreativeTabs; 11 | import net.minecraft.enchantment.EnchantmentHelper; 12 | import net.minecraft.entity.Entity; 13 | import net.minecraft.entity.EntityLivingBase; 14 | import net.minecraft.entity.SharedMonsterAttributes; 15 | import net.minecraft.entity.ai.attributes.AttributeModifier; 16 | import net.minecraft.entity.player.EntityPlayer; 17 | import net.minecraft.init.Enchantments; 18 | import net.minecraft.init.MobEffects; 19 | import net.minecraft.init.SoundEvents; 20 | import net.minecraft.inventory.EntityEquipmentSlot; 21 | import net.minecraft.item.EnumRarity; 22 | import net.minecraft.item.Item; 23 | import net.minecraft.item.ItemStack; 24 | import net.minecraft.item.ItemSword; 25 | import net.minecraft.nbt.NBTTagCompound; 26 | import net.minecraft.util.ResourceLocation; 27 | import net.minecraft.util.SoundCategory; 28 | import net.minecraft.util.math.BlockPos; 29 | import net.minecraft.world.World; 30 | import net.minecraftforge.fml.relauncher.Side; 31 | import net.minecraftforge.fml.relauncher.SideOnly; 32 | 33 | import javax.annotation.Nonnull; 34 | import java.util.List; 35 | 36 | public class ItemSwordRF extends ItemSword implements IMultiModeItem, IEnergyContainerItem { 37 | 38 | protected int maxEnergy = 160000; 39 | protected int maxTransfer = 1600; 40 | 41 | protected int energyPerUse = 200; 42 | protected int energyPerUseCharged = 800; 43 | 44 | protected int damage = 8; 45 | protected int damageCharged = 4; 46 | protected float attackSpeed = -2.2F; 47 | 48 | protected boolean showInCreative = true; 49 | 50 | public ItemSwordRF(ToolMaterial toolMaterial) { 51 | 52 | super(toolMaterial); 53 | setNoRepair(); 54 | 55 | addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> ItemSwordRF.this.getEnergyStored(stack) > 0 && !ItemSwordRF.this.isEmpowered(stack) ? 1F : 0F); 56 | addPropertyOverride(new ResourceLocation("empowered"), (stack, world, entity) -> ItemSwordRF.this.isEmpowered(stack) ? 1F : 0F); 57 | } 58 | 59 | public ItemSwordRF setEnergyParams(int maxEnergy, int maxTransfer, int energyPerUse, int energyPerUseCharged) { 60 | 61 | this.maxEnergy = maxEnergy; 62 | this.maxTransfer = maxTransfer; 63 | this.energyPerUse = energyPerUse; 64 | this.energyPerUseCharged = energyPerUseCharged; 65 | 66 | return this; 67 | } 68 | 69 | public ItemSwordRF setShowInCreative(boolean showInCreative) { 70 | 71 | this.showInCreative = showInCreative; 72 | return this; 73 | } 74 | 75 | protected boolean isEmpowered(ItemStack stack) { 76 | 77 | return getMode(stack) == 1 && getEnergyStored(stack) > energyPerUseCharged; 78 | } 79 | 80 | protected int getEnergyPerUse(ItemStack stack) { 81 | 82 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 83 | return (isEmpowered(stack) ? energyPerUseCharged : energyPerUse) * (5 - unbreakingLevel) / 5; 84 | } 85 | 86 | protected int useEnergy(ItemStack stack, boolean simulate) { 87 | 88 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 89 | return extractEnergy(stack, isEmpowered(stack) ? energyPerUseCharged * (5 - unbreakingLevel) / 5 : energyPerUse * (5 - unbreakingLevel) / 5, simulate); 90 | } 91 | 92 | @Override 93 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean check) { 94 | 95 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 96 | list.add(StringHelper.shiftForDetails()); 97 | } 98 | if (!StringHelper.isShiftKeyDown()) { 99 | return; 100 | } 101 | if (stack.getTagCompound() == null) { 102 | EnergyHelper.setDefaultEnergyTag(stack, 0); 103 | } 104 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 105 | 106 | list.add(StringHelper.ORANGE + getEnergyPerUse(stack) + " " + StringHelper.localize("info.redstonearsenal.tool.energyPerUse") + StringHelper.END); 107 | RAProps.addEmpoweredTip(this, stack, list); 108 | if (getEnergyStored(stack) >= getEnergyPerUse(stack)) { 109 | int adjustedDamage = (int) (damage + player.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue()); 110 | list.add(""); 111 | list.add(StringHelper.LIGHT_BLUE + "+" + adjustedDamage + " " + StringHelper.localize("info.cofh.damageAttack") + StringHelper.END); 112 | list.add(StringHelper.BRIGHT_GREEN + "+" + (isEmpowered(stack) ? damageCharged : 1) + " " + StringHelper.localize("info.cofh.damageFlux") + StringHelper.END); 113 | } 114 | } 115 | 116 | @Override 117 | @SideOnly (Side.CLIENT) 118 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 119 | 120 | if (showInCreative) { 121 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), 0)); 122 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item, 1, 0), maxEnergy)); 123 | } 124 | } 125 | 126 | @Override 127 | public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { 128 | 129 | if (stack.getItemDamage() > 0) { 130 | stack.setItemDamage(0); 131 | } 132 | } 133 | 134 | @Override 135 | public void setDamage(ItemStack stack, int damage) { 136 | 137 | super.setDamage(stack, 0); 138 | } 139 | 140 | @Override 141 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 142 | 143 | return false; 144 | } 145 | 146 | @Override 147 | public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase player) { 148 | 149 | if (stack.getItemDamage() > 0) { 150 | stack.setItemDamage(0); 151 | } 152 | EntityPlayer thePlayer = (EntityPlayer) player; 153 | 154 | if (thePlayer.capabilities.isCreativeMode || useEnergy(stack, false) == getEnergyPerUse(stack)) { 155 | int fluxDamage = isEmpowered(stack) ? damageCharged : 1; 156 | 157 | float potionDamage = 1.0f; 158 | if (player.isPotionActive(MobEffects.STRENGTH)) { 159 | potionDamage += player.getActivePotionEffect(MobEffects.STRENGTH).getAmplifier() * 1.3f; 160 | } 161 | entity.attackEntityFrom(DamageHelper.causePlayerFluxDamage(thePlayer), fluxDamage * potionDamage); 162 | } 163 | return true; 164 | } 165 | 166 | @Override 167 | public boolean isDamaged(ItemStack stack) { 168 | 169 | return true; 170 | } 171 | 172 | @Override 173 | public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLivingy) { 174 | 175 | if (state.getBlockHardness(world, pos) != 0.0D) { 176 | extractEnergy(stack, energyPerUse, false); 177 | } 178 | return true; 179 | } 180 | 181 | @Override 182 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 183 | 184 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 185 | } 186 | 187 | @Override 188 | public boolean showDurabilityBar(ItemStack stack) { 189 | 190 | return RAProps.showToolCharge && stack.getTagCompound() != null && !stack.getTagCompound().getBoolean("CreativeTab"); 191 | } 192 | 193 | @Override 194 | public int getMaxDamage(ItemStack stack) { 195 | 196 | return 0; 197 | } 198 | 199 | @Override 200 | public double getDurabilityForDisplay(ItemStack stack) { 201 | 202 | if (stack.getTagCompound() == null) { 203 | EnergyHelper.setDefaultEnergyTag(stack, 0); 204 | } 205 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 206 | } 207 | 208 | @Override 209 | public EnumRarity getRarity(ItemStack stack) { 210 | 211 | return isEmpowered(stack) ? EnumRarity.RARE : EnumRarity.UNCOMMON; 212 | } 213 | 214 | @Override 215 | public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { 216 | 217 | Multimap multimap = HashMultimap.create(); 218 | 219 | if (slot == EntityEquipmentSlot.MAINHAND) { 220 | multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", attackSpeed, 0)); 221 | 222 | if (useEnergy(stack, true) == getEnergyPerUse(stack)) { 223 | int fluxDamage = isEmpowered(stack) ? damageCharged : 1; 224 | multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", fluxDamage + damage, 0)); 225 | } else { 226 | multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", 1, 0)); 227 | } 228 | } 229 | 230 | return multimap; 231 | } 232 | 233 | /* IMultiModeItem */ 234 | @Override 235 | public int getMode(ItemStack stack) { 236 | 237 | return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Mode"); 238 | } 239 | 240 | @Override 241 | public boolean setMode(ItemStack stack, int mode) { 242 | 243 | if (!stack.hasTagCompound()) { 244 | stack.setTagCompound(new NBTTagCompound()); 245 | } 246 | stack.getTagCompound().setInteger("Mode", mode); 247 | return false; 248 | } 249 | 250 | @Override 251 | public boolean incrMode(ItemStack stack) { 252 | 253 | if (!stack.hasTagCompound()) { 254 | stack.setTagCompound(new NBTTagCompound()); 255 | } 256 | int curMode = getMode(stack); 257 | curMode++; 258 | if (curMode >= getNumModes(stack)) { 259 | curMode = 0; 260 | } 261 | stack.getTagCompound().setInteger("Mode", curMode); 262 | return true; 263 | } 264 | 265 | @Override 266 | public boolean decrMode(ItemStack stack) { 267 | 268 | if (!stack.hasTagCompound()) { 269 | stack.setTagCompound(new NBTTagCompound()); 270 | } 271 | int curMode = getMode(stack); 272 | curMode--; 273 | if (curMode <= 0) { 274 | curMode = getNumModes(stack) - 1; 275 | } 276 | stack.getTagCompound().setInteger("Mode", curMode); 277 | return true; 278 | } 279 | 280 | @Override 281 | public int getNumModes(ItemStack stack) { 282 | 283 | return 2; 284 | } 285 | 286 | @Override 287 | public void onModeChange(EntityPlayer player, ItemStack stack) { 288 | 289 | if (isEmpowered(stack)) { 290 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_LIGHTNING_THUNDER, SoundCategory.PLAYERS, 0.4F, 1.0F); 291 | } else { 292 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_TOUCH, SoundCategory.PLAYERS, 0.2F, 0.6F); 293 | } 294 | } 295 | 296 | /* IEnergyContainerItem */ 297 | @Override 298 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 299 | 300 | if (container.getTagCompound() == null) { 301 | EnergyHelper.setDefaultEnergyTag(container, 0); 302 | } 303 | int stored = container.getTagCompound().getInteger("Energy"); 304 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 305 | 306 | if (!simulate) { 307 | stored += receive; 308 | container.getTagCompound().setInteger("Energy", stored); 309 | } 310 | return receive; 311 | } 312 | 313 | @Override 314 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 315 | 316 | if (container.getTagCompound() == null) { 317 | EnergyHelper.setDefaultEnergyTag(container, 0); 318 | } 319 | if (container.getTagCompound().hasKey("Unbreakable")) { 320 | container.getTagCompound().removeTag("Unbreakable"); 321 | } 322 | int stored = container.getTagCompound().getInteger("Energy"); 323 | int extract = Math.min(maxExtract, stored); 324 | 325 | if (!simulate) { 326 | stored -= extract; 327 | container.getTagCompound().setInteger("Energy", stored); 328 | 329 | if (stored == 0) { 330 | setMode(container, 0); 331 | } 332 | } 333 | return extract; 334 | } 335 | 336 | @Override 337 | public int getEnergyStored(ItemStack container) { 338 | 339 | if (container.getTagCompound() == null) { 340 | EnergyHelper.setDefaultEnergyTag(container, 0); 341 | } 342 | return container.getTagCompound().getInteger("Energy"); 343 | } 344 | 345 | @Override 346 | public int getMaxEnergyStored(ItemStack container) { 347 | 348 | return maxEnergy; 349 | } 350 | 351 | } 352 | -------------------------------------------------------------------------------- /src/main/java/cofh/redstonearsenal/item/tool/ItemToolRF.java: -------------------------------------------------------------------------------- 1 | package cofh.redstonearsenal.item.tool; 2 | 3 | import cofh.api.energy.IEnergyContainerItem; 4 | import cofh.api.item.IMultiModeItem; 5 | import cofh.core.item.tool.ItemToolCore; 6 | import cofh.lib.util.helpers.*; 7 | import cofh.redstonearsenal.init.RAProps; 8 | import com.google.common.collect.HashMultimap; 9 | import com.google.common.collect.Multimap; 10 | import net.minecraft.block.state.IBlockState; 11 | import net.minecraft.creativetab.CreativeTabs; 12 | import net.minecraft.enchantment.EnchantmentHelper; 13 | import net.minecraft.entity.Entity; 14 | import net.minecraft.entity.EntityLivingBase; 15 | import net.minecraft.entity.SharedMonsterAttributes; 16 | import net.minecraft.entity.ai.attributes.AttributeModifier; 17 | import net.minecraft.entity.player.EntityPlayer; 18 | import net.minecraft.init.Enchantments; 19 | import net.minecraft.init.MobEffects; 20 | import net.minecraft.init.SoundEvents; 21 | import net.minecraft.inventory.EntityEquipmentSlot; 22 | import net.minecraft.item.EnumRarity; 23 | import net.minecraft.item.Item; 24 | import net.minecraft.item.ItemStack; 25 | import net.minecraft.nbt.NBTTagCompound; 26 | import net.minecraft.util.ResourceLocation; 27 | import net.minecraft.util.SoundCategory; 28 | import net.minecraft.world.World; 29 | import net.minecraftforge.fml.relauncher.Side; 30 | import net.minecraftforge.fml.relauncher.SideOnly; 31 | 32 | import javax.annotation.Nonnull; 33 | import java.util.List; 34 | 35 | public abstract class ItemToolRF extends ItemToolCore implements IMultiModeItem, IEnergyContainerItem { 36 | 37 | protected int maxEnergy = 160000; 38 | protected int maxTransfer = 1600; 39 | 40 | protected int energyPerUse = 200; 41 | protected int energyPerUseCharged = 800; 42 | 43 | protected int damage = 0; 44 | 45 | public ItemToolRF(float baseDamage, float attackSpeed, ToolMaterial toolMaterial) { 46 | 47 | super(baseDamage, attackSpeed, toolMaterial); 48 | setNoRepair(); 49 | 50 | addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> ItemToolRF.this.getEnergyStored(stack) > 0 && !ItemToolRF.this.isEmpowered(stack) ? 1F : 0F); 51 | addPropertyOverride(new ResourceLocation("empowered"), (stack, world, entity) -> ItemToolRF.this.isEmpowered(stack) ? 1F : 0F); 52 | } 53 | 54 | public ItemToolRF(float attackSpeed, ToolMaterial toolMaterial) { 55 | 56 | this(0, attackSpeed, toolMaterial); 57 | } 58 | 59 | public ItemToolRF setEnergyParams(int maxEnergy, int maxTransfer, int energyPerUse, int energyPerUseCharged) { 60 | 61 | this.maxEnergy = maxEnergy; 62 | this.maxTransfer = maxTransfer; 63 | this.energyPerUse = energyPerUse; 64 | this.energyPerUseCharged = energyPerUseCharged; 65 | 66 | return this; 67 | } 68 | 69 | protected boolean isEmpowered(ItemStack stack) { 70 | 71 | return getMode(stack) == 1 && getEnergyStored(stack) > energyPerUseCharged; 72 | } 73 | 74 | protected int getEnergyPerUse(ItemStack stack) { 75 | 76 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 77 | return (isEmpowered(stack) ? energyPerUseCharged : energyPerUse) * (5 - unbreakingLevel) / 5; 78 | } 79 | 80 | protected int useEnergy(ItemStack stack, boolean simulate) { 81 | 82 | int unbreakingLevel = MathHelper.clamp(EnchantmentHelper.getEnchantmentLevel(Enchantments.UNBREAKING, stack), 0, 4); 83 | return extractEnergy(stack, isEmpowered(stack) ? energyPerUseCharged * (5 - unbreakingLevel) / 5 : energyPerUse * (5 - unbreakingLevel) / 5, simulate); 84 | } 85 | 86 | @Override 87 | protected float getEfficiency(ItemStack stack) { 88 | 89 | if (isEmpowered(stack) && getEnergyStored(stack) >= energyPerUseCharged) { 90 | return efficiencyOnProperMaterial * 1.5F; 91 | } 92 | return efficiencyOnProperMaterial; 93 | } 94 | 95 | @Override 96 | public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { 97 | 98 | if (StringHelper.displayShiftForDetail && !StringHelper.isShiftKeyDown()) { 99 | list.add(StringHelper.shiftForDetails()); 100 | } 101 | if (!StringHelper.isShiftKeyDown()) { 102 | return; 103 | } 104 | if (stack.getTagCompound() == null) { 105 | EnergyHelper.setDefaultEnergyTag(stack, 0); 106 | } 107 | list.add(StringHelper.localize("info.cofh.charge") + ": " + stack.getTagCompound().getInteger("Energy") + " / " + maxEnergy + " RF"); 108 | 109 | list.add(StringHelper.ORANGE + getEnergyPerUse(stack) + " " + StringHelper.localize("info.redstonearsenal.tool.energyPerUse") + StringHelper.END); 110 | RAProps.addEmpoweredTip(this, stack, list); 111 | if (getEnergyStored(stack) >= getEnergyPerUse(stack)) { 112 | int adjustedDamage = (int) (damage + player.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getBaseValue()); 113 | list.add(""); 114 | list.add(StringHelper.LIGHT_BLUE + "+" + adjustedDamage + " " + StringHelper.localize("info.cofh.damageAttack") + StringHelper.END); 115 | list.add(StringHelper.BRIGHT_GREEN + "+" + (isEmpowered(stack) ? 2 : 1) + " " + StringHelper.localize("info.cofh.damageFlux") + StringHelper.END); 116 | } 117 | } 118 | 119 | @Override 120 | @SideOnly (Side.CLIENT) 121 | public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { 122 | 123 | if (showInCreative) { 124 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item), 0)); 125 | list.add(EnergyHelper.setDefaultEnergyTag(new ItemStack(item), maxEnergy)); 126 | } 127 | } 128 | 129 | @Override 130 | public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { 131 | 132 | if (stack.getItemDamage() > 0) { 133 | stack.setItemDamage(0); 134 | } 135 | } 136 | 137 | @Override 138 | public void setDamage(ItemStack stack, int damage) { 139 | 140 | super.setDamage(stack, 0); 141 | } 142 | 143 | @Override 144 | public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) { 145 | 146 | return false; 147 | } 148 | 149 | @Override 150 | public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase player) { 151 | 152 | if (stack.getItemDamage() > 0) { 153 | stack.setItemDamage(0); 154 | } 155 | EntityPlayer thePlayer = (EntityPlayer) player; 156 | 157 | if (thePlayer.capabilities.isCreativeMode || extractEnergy(stack, energyPerUse, false) == energyPerUse) { 158 | int fluxDamage = isEmpowered(stack) ? 2 : 1; 159 | 160 | float potionDamage = 1.0f; 161 | if (player.isPotionActive(MobEffects.STRENGTH)) { 162 | potionDamage += player.getActivePotionEffect(MobEffects.STRENGTH).getAmplifier() * 1.3f; 163 | } 164 | entity.attackEntityFrom(DamageHelper.causePlayerFluxDamage(thePlayer), fluxDamage * potionDamage); 165 | } 166 | return true; 167 | } 168 | 169 | @Override 170 | public boolean isDamaged(ItemStack stack) { 171 | 172 | return true; 173 | } 174 | 175 | @Override 176 | public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { 177 | 178 | return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged) && (slotChanged || !ItemHelper.areItemStacksEqualIgnoreTags(oldStack, newStack, "Energy")); 179 | } 180 | 181 | @Override 182 | public boolean showDurabilityBar(ItemStack stack) { 183 | 184 | return RAProps.showToolCharge && stack.getTagCompound() != null && !stack.getTagCompound().getBoolean("CreativeTab"); 185 | } 186 | 187 | @Override 188 | public int getMaxDamage(ItemStack stack) { 189 | 190 | return 0; 191 | } 192 | 193 | @Override 194 | public float getStrVsBlock(ItemStack stack, IBlockState state) { 195 | 196 | if (getEnergyStored(stack) < energyPerUse) { 197 | return 1.0F; 198 | } 199 | return super.getStrVsBlock(stack, state); 200 | } 201 | 202 | @Override 203 | public double getDurabilityForDisplay(ItemStack stack) { 204 | 205 | if (stack.getTagCompound() == null) { 206 | EnergyHelper.setDefaultEnergyTag(stack, 0); 207 | } 208 | return 1D - (double) stack.getTagCompound().getInteger("Energy") / (double) maxEnergy; 209 | } 210 | 211 | @Override 212 | public EnumRarity getRarity(ItemStack stack) { 213 | 214 | return isEmpowered(stack) ? EnumRarity.RARE : EnumRarity.UNCOMMON; 215 | } 216 | 217 | @Override 218 | public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { 219 | 220 | Multimap multimap = HashMultimap.create(); 221 | 222 | if (slot == EntityEquipmentSlot.MAINHAND) { 223 | multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) this.attackSpeed, 0)); 224 | 225 | if (extractEnergy(stack, energyPerUse, true) == energyPerUse) { 226 | int fluxDamage = isEmpowered(stack) ? 2 : 1; 227 | multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", fluxDamage + damage, 0)); 228 | } else { 229 | multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", 1, 0)); 230 | } 231 | } 232 | return multimap; 233 | } 234 | 235 | /* IMultiModeItem */ 236 | @Override 237 | public int getMode(ItemStack stack) { 238 | 239 | return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Mode"); 240 | } 241 | 242 | @Override 243 | public boolean setMode(ItemStack stack, int mode) { 244 | 245 | if (!stack.hasTagCompound()) { 246 | stack.setTagCompound(new NBTTagCompound()); 247 | } 248 | stack.getTagCompound().setInteger("Mode", mode); 249 | return false; 250 | } 251 | 252 | @Override 253 | public boolean incrMode(ItemStack stack) { 254 | 255 | if (!stack.hasTagCompound()) { 256 | stack.setTagCompound(new NBTTagCompound()); 257 | } 258 | int curMode = getMode(stack); 259 | curMode++; 260 | if (curMode >= getNumModes(stack)) { 261 | curMode = 0; 262 | } 263 | stack.getTagCompound().setInteger("Mode", curMode); 264 | return true; 265 | } 266 | 267 | @Override 268 | public boolean decrMode(ItemStack stack) { 269 | 270 | if (!stack.hasTagCompound()) { 271 | stack.setTagCompound(new NBTTagCompound()); 272 | } 273 | int curMode = getMode(stack); 274 | curMode--; 275 | if (curMode <= 0) { 276 | curMode = getNumModes(stack) - 1; 277 | } 278 | stack.getTagCompound().setInteger("Mode", curMode); 279 | return true; 280 | } 281 | 282 | @Override 283 | public int getNumModes(ItemStack stack) { 284 | 285 | return 2; 286 | } 287 | 288 | @Override 289 | public void onModeChange(EntityPlayer player, ItemStack stack) { 290 | 291 | if (isEmpowered(stack)) { 292 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_LIGHTNING_THUNDER, SoundCategory.PLAYERS, 0.4F, 1.0F); 293 | } else { 294 | player.worldObj.playSound(null, player.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_TOUCH, SoundCategory.PLAYERS, 0.2F, 0.6F); 295 | } 296 | } 297 | 298 | /* IEnergyContainerItem */ 299 | @Override 300 | public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { 301 | 302 | if (container.getTagCompound() == null) { 303 | EnergyHelper.setDefaultEnergyTag(container, 0); 304 | } 305 | int stored = container.getTagCompound().getInteger("Energy"); 306 | int receive = Math.min(maxReceive, Math.min(maxEnergy - stored, maxTransfer)); 307 | 308 | if (!simulate) { 309 | stored += receive; 310 | container.getTagCompound().setInteger("Energy", stored); 311 | } 312 | return receive; 313 | } 314 | 315 | @Override 316 | public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { 317 | 318 | if (container.getTagCompound() == null) { 319 | EnergyHelper.setDefaultEnergyTag(container, 0); 320 | } 321 | if (container.getTagCompound().hasKey("Unbreakable")) { 322 | container.getTagCompound().removeTag("Unbreakable"); 323 | } 324 | int stored = container.getTagCompound().getInteger("Energy"); 325 | int extract = Math.min(maxExtract, stored); 326 | 327 | if (!simulate) { 328 | stored -= extract; 329 | container.getTagCompound().setInteger("Energy", stored); 330 | 331 | if (stored == 0) { 332 | setMode(container, 0); 333 | } 334 | } 335 | return extract; 336 | } 337 | 338 | @Override 339 | public int getEnergyStored(ItemStack container) { 340 | 341 | if (container.getTagCompound() == null) { 342 | EnergyHelper.setDefaultEnergyTag(container, 0); 343 | } 344 | return container.getTagCompound().getInteger("Energy"); 345 | } 346 | 347 | @Override 348 | public int getMaxEnergyStored(ItemStack container) { 349 | 350 | return maxEnergy; 351 | } 352 | 353 | } 354 | --------------------------------------------------------------------------------